-
Notifications
You must be signed in to change notification settings - Fork 4
154 lines (149 loc) · 4.89 KB
/
nox.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
142
143
144
145
146
147
148
149
150
151
152
153
154
---
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or
# https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: 2023 Maxwell G <[email protected]
name: nox
'on':
push:
branches: [main]
pull_request:
branches: [main]
# Run once per week (Monday at 04:00 UTC)
schedule:
- cron: '0 4 * * 1'
workflow_dispatch:
env:
FORCE_COLOR: "1"
jobs:
nox:
runs-on: ubuntu-latest
defaults:
run:
working-directory: antsibull-docs-parser
strategy:
fail-fast: false
matrix:
include:
- session: test
python-versions: "3.8, 3.9, 3.10, 3.11, 3.12, 3.13"
other-args: "-p 3.8 3.9 3.10 3.11 3.12 3.13"
codecov: true
packages: ""
- session: lint
python-versions: "3.13"
other-args: ""
codecov: false
packages: ""
- session: create_vectors
python-versions: "3.13"
other-args: ""
codecov: false
packages: ""
name: "Run nox ${{ matrix.session }} session"
steps:
- name: Check out antsibull-docs-parser
uses: actions/checkout@v4
with:
path: antsibull-docs-parser
persist-credentials: false
- name: Install extra packages
if: "matrix.packages != ''"
run: |
sudo apt-get install -y ${{ matrix.packages }}
- name: Setup nox
uses: wntrblm/[email protected]
with:
python-versions: "${{ matrix.python-versions }}"
- name: Set up nox environments
run: |
nox -v -e "${{ matrix.session }}" ${{ matrix.other-args }} --install-only
${{ matrix.codecov && 'nox -v -e coverage --install-only' || '' }}
- name: "Run nox -e ${{ matrix.session }} ${{ matrix.other-args }}"
run: |
nox -v -e "${{ matrix.session }}" ${{ matrix.other-args }} --reuse-existing-virtualenvs --no-install
- name: Report coverage
if: ${{ matrix.codecov }}
run: |
nox -v -e coverage --reuse-existing-virtualenvs --no-install
- name: Upload coverage
if: ${{ matrix.codecov }}
uses: codecov/codecov-action@v5
with:
name: "${{ matrix.session }}"
working-directory: antsibull-docs-parser
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
nox-test-37:
# python3.7 is not available on ubuntu-latest
runs-on: ubuntu-22.04
name: "Run nox test session (Python 3.7)"
defaults:
run:
working-directory: antsibull-docs-parser
steps:
- name: Check out antsibull-docs-parser
uses: actions/checkout@v4
with:
path: antsibull-docs-parser
persist-credentials: false
- name: Setup nox
uses: wntrblm/[email protected]
with:
python-versions: "3.7"
- name: Set up nox environments
run: |
nox -v -e "test" -p 3.7 --install-only
nox -v -e coverage --install-only
- name: "Run nox -e test -p 3.7"
run: |
nox -v -e "test" -p 3.7 --reuse-existing-virtualenvs --no-install
- name: Report coverage
run: |
nox -v -e coverage --reuse-existing-virtualenvs --no-install
- name: Upload coverage
uses: codecov/codecov-action@v5
with:
name: "test"
working-directory: antsibull-docs-parser
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
nox-test-36:
# python3.6 is not available on ubuntu-latest
runs-on: ubuntu-20.04
name: "Run nox test session (Python 3.6)"
defaults:
run:
working-directory: antsibull-docs-parser
steps:
- name: Check out antsibull-docs-parser
uses: actions/checkout@v4
with:
path: antsibull-docs-parser
persist-credentials: false
- name: Setup nox
uses: wntrblm/[email protected] # DO NOT UPDATE THIS! Newer versions do not work with Python 3.6
with:
python-versions: "3.6"
# https://github.com/ansible-community/antsibull-docs-parser/issues/25
# Newer virtualenv versions seem to cause failures with Python 3.6
- name: Setup nox - downgrade virtualenv
run: |
pipx inject --force nox 'virtualenv<20.22.0'
- name: Set up nox environments
run: |
nox -v -e test -p 3.6 --install-only
nox -v -e coverage --install-only
- name: Run unit tests
run: |
nox -v -e test -p 3.6 --reuse-existing-virtualenvs --no-install
- name: Report coverage
run: |
nox -v -e coverage --reuse-existing-virtualenvs --no-install
- name: Upload coverage
uses: codecov/codecov-action@v5
with:
name: nox-test-36
working-directory: antsibull-docs-parser
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}