-
Notifications
You must be signed in to change notification settings - Fork 0
140 lines (138 loc) · 3.78 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
name: CI testing
on:
pull_request: {}
push:
branches:
- main
- release-candidate-*
tags:
- v*
workflow_dispatch:
inputs:
debug_enabled:
description: Run the build with SSH debugging enabled
type: boolean
required: false
default: false
defaults:
run:
shell: bash -el {0}
jobs:
static:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: ./actions/setup
with:
python-version: "3.11"
- uses: ./actions/generate-and-check
- uses: ./actions/run-script
with:
name: static
test:
needs:
- static
timeout-minutes: 30
strategy:
matrix:
include:
- script: docs
- script: examples
- script: test
test_local_var: test local var val
test_args: --test-arg --test-arg
- script: test-coverage
test_local_var: test local var val
test_args: --test-arg
coverage-name: test-coverage
- script: test-coverage
test_local_var: test local var val
test_args: --test-arg
python: "3.8"
runs-on: ubuntu-20.04
coverage-name: test-coverage-oldest
- script: test-nengo
test_local_var: test local var val
test_args: --test-arg
python: "3.11"
fail-fast: false
runs-on: ${{ matrix.runs-on || 'ubuntu-latest' }}
env:
SCRIPT: ${{ matrix.script }}
TEST_GLOBAL_VAR: test global var val
TEST_LOCAL_VAR: ${{ matrix.test_local_var || 'this val will be overwritten' }}
SSH_KEY: ${{ secrets.SSH_KEY }}
SSH_CONFIG: ${{ secrets.SSH_CONFIG }}
TEST_ARGS: ${{ matrix.test_args }}
GH_TOKEN: ${{ secrets.PUBLIC_GH_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
path: action-checkout
- uses: ./action-checkout/actions/setup
with:
path: nengo-bones
python-version: ${{ matrix.python || '3.9' }}
- uses: ./action-checkout/actions/generate-and-check
with:
path: nengo-bones
- name: Docs setup
if: ${{ matrix.script == 'docs' }}
run: |
micromamba install pandoc
- uses: ./action-checkout/actions/run-script
with:
name: ${{ matrix.script }}
path: nengo-bones
- uses: actions/upload-artifact@v4
if: ${{ always() && matrix.coverage-name }}
with:
name: coverage-${{ matrix.coverage-name }}
path: nengo-bones/.coverage
coverage:
if: ${{ always() }}
needs:
- test
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: ./actions/coverage-report
auto-update:
needs:
- test
if: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
runs-on: ubuntu-latest
timeout-minutes: 30
env:
GH_TOKEN: ${{ secrets.PUBLIC_GH_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: ./actions/setup
with:
python-version: "3.11"
- uses: ./actions/generate-and-check
- uses: ./actions/run-script
with:
name: auto-update
deploy:
needs:
- test
if: >-
startsWith(github.ref_name, 'release-candidate-') ||
(github.ref_type == 'tag' && startsWith(github.ref_name, 'v'))
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Write .pypirc to file
run: |
echo '${{ secrets.PYPIRC_FILE }}' > ~/.pypirc
- uses: actions/checkout@v4
- uses: ./actions/setup
with:
python-version: "3.10"
- uses: ./actions/generate-and-check
- uses: ./actions/run-script
with:
name: deploy