-
Notifications
You must be signed in to change notification settings - Fork 3
74 lines (70 loc) · 2.22 KB
/
test_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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: test build
on:
push:
branches: ["master"]
pull_request:
branches: ["*"]
jobs:
changes:
name: Checking changed files
runs-on: ubuntu-latest
outputs:
keepgoing: ${{ steps.changed-files.outputs.any_changed }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41
with:
files: |
**/*.{yml,py}
tests
- name: List all changed files
run: |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
echo "$file was changed"
done
echo ${{ steps.changed-files.outputs.any_changed }}
build:
needs:
- changes
if: needs.changes.outputs.keepgoing == 'true'
defaults:
run:
shell: bash -l {0}
strategy:
max-parallel: 6
matrix:
config:
- { python-version: 3.8, os: ubuntu-latest }
- { python-version: 3.9, os: ubuntu-latest }
- { python-version: "3.10", os: ubuntu-latest }
- { python-version: "3.11", os: ubuntu-latest }
- { python-version: "3.12", os: ubuntu-latest }
- { python-version: 3.8, os: macos-latest }
- { python-version: 3.9, os: macos-latest }
- { python-version: "3.10", os: macos-latest }
- { python-version: "3.11", os: macos-latest }
- { python-version: "3.12", os: macos-latest }
runs-on: ${{ matrix.config.os }}
env:
TZ: UTC
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.config.python-version }}
cache: "pip"
cache-dependency-path: |
**/pyproject.toml
- name: Install
run: |
python -m pip install .
shell: bash {0}