-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheasemlci.yml
More file actions
executable file
·79 lines (72 loc) · 3.17 KB
/
easemlci.yml
File metadata and controls
executable file
·79 lines (72 loc) · 3.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Easeml/CI
on:
pull_request:
branches:
- '**'
push:
branches:
- 'master'
- 'feature/cicd'
create:
tags:
- 'v*'
env:
CI: true
TERM: xterm
jobs:
easeml_ci:
runs-on: ubuntu-latest
steps:
- name: Install Prerequisites
run: |
echo "Initializing the software prerequisites"
sudo apt update
sudo apt install -y jq
sudo apt install -y build-essential python3-dev libssl-dev libffi-dev
sudo apt install -y ca-certificates curl gnupg lsb-release
echo "Installing docker"
echo "Adding docker gpg key"
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "Setting the correct docker repository"
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
echo "Updating APT"
sudo apt update
echo "Installing Docker engine"
sudo apt install -y docker-ce docker-ce-cli containerd.io
echo "Enabling non sudo use of docker"
sudo usermod -aG docker $USER
newgrp docker
echo "Installing Easeml/CI"
pip install git+https://github.com/easeml/ci.git@feature/actions
pip uninstall gnupg
pip install python-gnupg
echo "Adding decryption and encryption keys"
mkdir -p $HOME/.easeml/keys
echo ${{ secrets.B64_EASEML_PRIV }} | base64 -d > $HOME/.easeml/keys/easeml_priv.asc
echo ${{ secrets.B64_EASEML_PUB }} | base64 -d > $HOME/.easeml/keys/easeml_pub.asc
- name: Run CI Test
run: |
# Set identity for commits
git config --global user.name ${GITHUB_ACTOR}
git config --global user.email ${GITHUB_ACTOR}@email
# Calling the ci runner
easeml_cicd_runner ${GITHUB_ACTOR} ${{ secrets.GITHUB_TOKEN }} ${GITHUB_REPOSITORY} ${GITHUB_SHA} ${GITHUB_REF_NAME} -g
- name: Eval CI Test
run: |
FILE=${GITHUB_REPOSITORY}/run_statistics.json
if [ -f "$FILE" ]; then
echo "Results exist."
echo "::notice ::Results Exists"
else
echo "Unable to find test results."
echo "::error ::Unable to find test results."
exit 1
fi
if [ $(jq .fail_type $FILE) -eq "0" ]; then
echo "Your model passed";
echo "::notice ::Your model passed"
else
echo "Your model did not pass";
echo "::error ::Your model did not pass"
exit 1
fi