-
Notifications
You must be signed in to change notification settings - Fork 14
133 lines (110 loc) · 3.9 KB
/
ci.yml
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Tests
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: '12.x'
- name: chmod
working-directory: .github/workflows
run: |
ls -la
chmod +x ./sendgrid.js
chmod +x deploy.sh
chmod +x filter.sh
chmod +x filter_errors.sh
- name: ROOT Dependencies
run: |
sudo apt update ;
sudo apt install -y build-essential;
sudo apt-get install dpkg-dev libc6 cmake g++ gcc binutils libx11-dev libxpm-dev \
libxft-dev libxext-dev python3 libssl-dev ;
#libglew1.5-dev
sudo apt-get install gfortran libpcre3-dev \
xlibmesa-glu-dev libftgl-dev \
libmysqlclient-dev libfftw3-dev libcfitsio-dev \
graphviz-dev libavahi-compat-libdnssd-dev \
libldap2-dev python3-dev libxml2-dev libkrb5-dev \
libgsl0-dev qtwebengine5-dev;
- name: Build ROOT
working-directory: .
run: |
wget https://root.cern/download/root_v6.26.04.Linux-ubuntu20-x86_64-gcc9.4.tar.gz
tar -xzvf root_v6.26.04.Linux-ubuntu20-x86_64-gcc9.4.tar.gz
rm -rf root_v6.26.04.Linux-ubuntu20-x86_64-gcc9.4.tar.gz
- name: CutLang Dependencies
run: |
sudo apt update
sudo apt install -y flex bison wget
- name: Build CutLang
working-directory: CLA
run: |
source ../root/bin/thisroot.sh; root --version; make
- name: Run Tests
working-directory: .github/workflows
run: |
source ../../root/bin/thisroot.sh; ./deploy.sh 2>&1 | tee ./raw_output.txt
- name: Filter Output
working-directory: .github/workflows
run: |
./filter.sh
./filter_errors.sh
cd ../previous;
diff raw_output.txt ../workflows/raw_output.txt | tee ../workflows/differences.txt;
echo ended tee
rm raw_output.txt errors.txt efficacy_charts.txt differences.txt;
echo ended rm
cd ../workflows;
cp raw_output.txt errors.txt efficacy_charts.txt differences.txt ../previous/;
echo ended cp raw_output
mkdir artifacts; mv raw_output.txt errors.txt efficacy_charts.txt differences.txt ./artifacts
if [ "`cat ./artifacts/errors.txt`" != "Errors: " ]; then
touch flag
fi
- name: Update Artifacts
if: ${{ github.event_name == 'push' }}
working-directory: .github/workflows
run: |
git --version
git status
target_date=`date "+%Y-%m-%d" -d "6 day ago"`
cur_date=`git log -1 --pretty="format:%cs" ../previous/raw_output.txt | tail -1`
echo target_date: $target_date
echo cur_date: $cur_date
tar_date_int=$(date -d $target_date +%s)
cur_date_int=$(date -d $cur_date +%s)
if [ $tar_date_int -le $cur_date_int ]; then
exit 0
fi
git config user.email "[email protected]"
git config user.name "bot"
git --version
git add ../previous
git --version
git status
git commit -m "automated update"
git --version
git status
git push origin ${GITHUB_REF##*/}
git --version
- name: Check for Bad Run Flag
id: check_files
uses: andstor/file-existence-action@v1
with:
files: "./.github/workflows/flag"
- name: SMTP
uses: peter-evans/sendgrid-action@v1
if: steps.check_files.outputs.files_exists == 'true'
env:
SENDGRID_API_KEY: ${{ secrets.SENDGRID_API_KEY }}
SCRIPT_FILEPATH: ./.github/workflows/sendgrid.js
- name: Upload Output File
uses: actions/[email protected]
with:
name: tests (ubuntu-latest)
path: ./.github/workflows/artifacts