-
Notifications
You must be signed in to change notification settings - Fork 4
143 lines (124 loc) · 4.04 KB
/
build-test.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
name: Fed-BioMed Build test
run-name: Fed-BioMed Build test
on:
pull_request:
types:
- opened
- synchronize
- reopened
- closed
- review_requested
- ready_for_review
branches:
- master
- develop
- 'feature/479-bug-in-integration-test' # \todo To remove when merging.
jobs:
build-doc:
name: Test documentation build
runs-on: ubuntu-latest
# if: ${{ github.event_name == 'push' || github.event.pull_request.opened == true }}
if: github.event.pull_request.draft == false
steps:
- name: Checkout to repository
uses: actions/checkout@v3
- name: Detect documentation changes
uses: dorny/paths-filter@master
id: filter
with:
filters: |
docs:
- 'fedbiomed/**'
- 'scripts/docs/**'
- 'docs/**'
- 'envs/development/**'
- 'envs/build/**'
- 'mkdocs.yml'
- 'README.md'
- name: Setup python
if: steps.filter.outputs.docs == 'true'
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Dependencies
if: steps.filter.outputs.docs == 'true'
run: pip install -r envs/build/docs-requirements.txt
- name: Build documentation
if: steps.filter.outputs.docs == 'true'
# Version number for testing purposes should respect to standart which is vMajor.Minor.Patch
run: scripts/docs/fedbiomed_doc.sh --build-dir build-repo --build-main --build-current-as v1.0.1
unit-test:
name: unit tests
strategy:
fail-fast: false
matrix:
os: [ubuntu-22-04, fedora38, macosx-m1]
runs-on: ${{ matrix.os }}
if: github.event.pull_request.draft == false
steps:
- name: Checkout to commit
uses: actions/checkout@v3
- name: Filter module related changes
uses: dorny/paths-filter@master
id: filter
with:
filters: |
module:
- 'fedbiomed/**'
- 'scripts/**'
- 'tests/**'
- 'envs/development/conda/**'
- 'envs/build/**'
- 'modules/**'
- 'MP-SPDZ/**'
- '.github/**'
- name: Run unit tests
id: unit-test
uses: ./.github/actions/unit-tests
if: steps.filter.outputs.module == 'true'
with:
test-dir: tests
- name: Upload coverage reports to Codecov
if: steps.filter.outputs.module == 'true' && matrix.os != 'macosx-m1'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: tests/coverage.xml
flags: unittests-${{ matrix.os }} # optional
name: codecov-umbrella # optional
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)
- name: Notify upload impossible on m1
if: steps.filter.outputs.module == 'true' && matrix.os == 'macosx-m1'
run: |
echo "No codecov-action available for macos-m1" # to check from time to time
mnist-test:
name: Test MNIST Notebook
strategy:
fail-fast: false
matrix:
os: [ubuntu-22-04, fedora38, macosx-m1]
runs-on: ${{ matrix.os }}
needs: unit-test
if: github.event.pull_request.draft == false
steps:
- name: Checkout to commit
uses: actions/checkout@v3
- name: Filter module related changes
uses: dorny/paths-filter@master
id: filter
with:
filters: |
module:
- 'fedbiomed/**'
- 'scripts/**'
- 'envs/development/conda/**'
- 'notebooks/**'
- '.github/**'
- name: Run MNIST Test - Master
if: steps.filter.outputs.module == 'true'
run: |
source ~/.bashrc
./scripts/configure_conda node
./scripts/run_test_mnist ../../../..
shell: bash -l {0}