-
Notifications
You must be signed in to change notification settings - Fork 23
155 lines (147 loc) · 5.01 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
name: CI
on:
push:
branches:
- 'devel*'
pull_request:
branches:
- 'devel*'
schedule:
- cron: '45 6 * * *'
jobs:
linting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m venv testenv
. testenv/bin/activate
python -m pip install --upgrade pip setuptools wheel
python -m pip install -r requirements-ci.txt
radical-stack
- name: Lint with flake8 and pylint
run: |
. testenv/bin/activate
LOG=`git log -n 1 | grep Merge` || echo 'no merging' && exit 0
NEW=`echo $LOG | cut -d ' ' -f2`
OLD=`echo $LOG | cut -d ' ' -f3`
(test -z "$NEW" || test -z "$OLD") && echo 'nothing to lint' && exit 0
DIFF=`git diff --name-only --diff-filter=db $NEW..$OLD`
FILTERED=$(for f in $DIFF; do echo $f; done | \
grep -v -e 'concepts/' -e '/archive/' | \
grep -e '\.py$' | sed "s|^|$PWD/|")
test -z "$FILTERED" && echo 'nothing to lint' && exit 0
flake8 $FILTERED
pylint $FILTERED
tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11' ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m venv testenv
. testenv/bin/activate
python -m pip install --upgrade pip setuptools wheel
python -m pip install -r requirements-ci.txt
radical-stack
- name: Unit tests
run: |
. testenv/bin/activate
radical-stack
coverage run --source=radical.pilot -m pytest -ra -vvv --showlocals tests/unit_tests/ tests/component_tests/
coverage xml
- uses: codecov/codecov-action@v3
if: ${{ matrix.python-version == '3.7' }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./coverage.xml
notebook_integration_test:
strategy:
matrix:
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11' ]
uses: ./.github/workflows/run-rp-notebook.yml
with:
python-version: ${{ matrix.python-version }}
requirements-file: 'requirements-docs-ci.txt'
notebook-name: 'getting_started.ipynb'
analytics:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest ]
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11' ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y texlive cm-super
sudo apt install -y texlive-fonts-extra texlive-extra-utils dvipng
sudo apt install -y texlive-fonts-recommended texlive-latex-extra
python -m venv testenv
. testenv/bin/activate
python -m pip install --upgrade pip setuptools wheel
python -m pip install -r requirements-ci.txt
- name: analyze example session
timeout-minutes: 5
if: always()
run: |
. testenv/bin/activate
./examples/00_getting_started.py local.localhost
SID=$(find . -name "rp.session*" -type d -exec basename {} "rp.session" \;)
echo "SID analyse example session: $SID"
radical-analytics-inspect "$SID"
mkdir artifacts
ls -la
cp -R *.png *.stats artifacts
- name: Collect session
if: always()
run: |
SIDCLIENT=$(find . -name "rp.session*" -type d -exec basename {} "rp.session" \;)
echo "SIDCLIENT collect session : $SIDCLIENT"
SIDAGENT="$HOME/radical.pilot.sandbox/$SIDCLIENT"
CLIENTNAME="analytics_client_$SIDCLIENT"
AGENTNAME="analytics_agent_$SIDCLIENT"
mkdir sessions_analytics
# tar cvfj $CLIENTNAME.tar.bz2 $SIDCLIENT
tar cvfj $CLIENTNAME.tar.bz2 `find $SIDCLIENT -type d -print`
cp -R $CLIENTNAME.tar.bz2 sessions_analytics
if [ -d "$SIDAGENT" ]; then
tar cvfj $AGENTNAME.tar.bz2 `find $SIDAGENT -type d -print`
cp -R $AGENTNAME.tar.bz2 sessions_analytics
fi
- name: upload artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: artifacts
path: artifacts
retention-days: 5
- name: upload sessions
if: always()
uses: actions/upload-artifact@v3
with:
name: sessions_analytics
path: sessions_analytics
retention-days: 5