-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (73 loc) · 2.64 KB
/
generate_test_reference.yaml
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
name: Generate Results and Store as Artifact
on:
# Run every month on the first day
schedule:
- cron: '0 0 1 * *'
# Allow manual triggering
workflow_dispatch:
# Check if github runner is updated
workflow_run:
workflows: ["Detect Runner Change"]
types:
- completed
jobs:
generate-secret:
# It runs only if the runner is updated or if manually triggered
if: ${{ github.event.workflow_run.conclusion == 'failure' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10']
toolchain:
- {compiler: gcc, version: 13}
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
submodules: 'true'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v3
id: cache-virtualenv
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}
- name: Install dependencies
if: steps.cache-virtualenv.outputs.cache-hit != 'true'
run: |
python -m pip install --upgrade pip
python -m pip install -e .[develop]
- name: Train the ResNet
run: |
python examples/example_train.py tests/test_data/conf_resnet.yaml
python examples/example_post.py tests/test_data/conf_resnet.yaml
- name: Upload ResNet results
uses: actions/upload-artifact@v4
with:
name: ResNet-results-${{ matrix.python-version }}
path: tests/test_data/speckles/Model_test_resnet_score
retention-days: 31
- name: Upload ResNet weights
uses: actions/upload-artifact@v4
with:
name: ResNet-weights-${{ matrix.python-version }}
path: tests/test_data/speckles/Model_test_resnet_states
retention-days: 31
- name: Train the SCNN
run: |
python examples/example_train.py tests/test_data/conf_scnn.yaml
python examples/example_post.py tests/test_data/conf_scnn.yaml
- name: Upload SCNN results
uses: actions/upload-artifact@v4
with:
name: SCNN-results-${{ matrix.python-version }}
path: tests/test_data/speckles/Model_test_scnn_score
retention-days: 31
- name: Upload SCNN weights
uses: actions/upload-artifact@v4
with:
name: SCNN-weights-${{ matrix.python-version }}
path: tests/test_data/speckles/Model_test_scnn_states
retention-days: 31