-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (51 loc) · 1.45 KB
/
build.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
# MIT licensed
name: openMINDS_Python_build_pipeline
on:
push:
branches:
- pipeline
workflow_dispatch: # This triggers the workflow when a webhook is received
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.12"]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Run build
run: |
pip install -r requirements.txt
python build.py
- name: Test built package
run: |
pip install pytest
pip install ./target
pytest -v pipeline/tests
- name: Checkout main branch
uses: actions/checkout@v4
with:
ref: main
path: main
token: ${{ secrets.GITHUB_TOKEN }}
if: ${{ matrix.python-version == 3.12 }}
- name: Push to main
if: ${{ matrix.python-version == 3.12 }}
run: |
cp -R target/* main
cd main
rm -rf build openMINDS.egg-info
git config --global user.email "openminds@ebrains.eu"
git config --global user.name "openMINDS pipeline"
if [[ $(git add . --dry-run | wc -l) -gt 0 ]]; then
git add .
git commit -m "build triggered by ${{ github.event_name }}"
git push -f
else
echo "Nothing to commit"
fi