-
Notifications
You must be signed in to change notification settings - Fork 68
151 lines (132 loc) · 4.17 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
name: CI
on: [push, pull_request]
# https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
# only cancel in-progress jobs or runs for the current workflow - matches against branch & tags
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pre-commit:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: 3.8
- name: Install prerequisites
run: pip install --upgrade pip
- name: Install
run: pip install -e .[pre-commit]
- name: Run pre-commit
run:
pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
test-webpage-build:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
- run: git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install prerequisites
run: pip install --upgrade wheel setuptools
- name: Install
run: pip install -e . -v
- name: Restore cached Plugins
id: cache-plugins-restore
uses: actions/cache/restore@v3
with:
path: |
plugins_metadata.json
key: plugins_metadata
- name: fetch metadata
if: steps.cache-plugins-restore.outputs.cache-hit != 'true'
id: fetch_metadata
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: aiida-registry fetch
- name: Cache plugins metadata
id: cache-plugins-save
uses: actions/cache/save@v3
with:
path: |
plugins_metadata.json
key: ${{ steps.cache-plugins-restore.outputs.cache-primary-key }}
- name: Move JSON file to the React project
run: |
mv plugins_metadata.json aiida-registry-app/src/
- uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Install npm dependencies and build
run: |
npm install
npm run build
working-directory: ./aiida-registry-app
install-plugins:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
fail-fast: false
timeout-minutes: 55
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
# Idea: create individual conda env for every tested package
# - uses: goanpeca/setup-miniconda@v1
# with:
# # auto-update-conda: true
# python-version: ${{ matrix.python-version }}
- name: Install prerequisites
run: pip install --upgrade pip
- name: Install
run: pip install -e . -v
- name: Restore cached Plugins
id: cache-plugins-restore
uses: actions/cache/restore@v3
with:
path: |
plugins_metadata.json
key: plugins_metadata
- name: fetch metadata
if: steps.cache-plugins-restore.outputs.cache-hit != 'true'
id: fetch_metadata
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: aiida-registry fetch
# # See https://github.com/geerlingguy/raspberry-pi-dramble/issues/166
# - name: Force GitHub Actions' docker daemon to use vfs.
# run: |
# sudo systemctl stop docker
# echo '{"cgroup-parent":"/actions_job","storage-driver":"vfs"}' | sudo tee /etc/docker/daemon.json
# sudo systemctl start docker
- name: Try installing packages
run: aiida-registry test-install
unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install prerequisites
run: pip install --upgrade pip
- name: Install
run: pip install -e .[testing] -v
- name: Run tests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: pytest tests/