-
Notifications
You must be signed in to change notification settings - Fork 67
116 lines (103 loc) · 3.15 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
name: CI
on: [push, pull_request]
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: fetch metadata
id: fetch_metadata
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: aiida-registry fetch
- 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: 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/