-
Notifications
You must be signed in to change notification settings - Fork 456
64 lines (60 loc) · 1.94 KB
/
tests.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
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# save workspaces to speed up testing
env:
FLOSS_SAVE_WORKSPACE: "True"
jobs:
code_style:
runs-on: ubuntu-20.04
# Pin action version by commit hash to maximize trust, ref: https://securitylab.github.com/research/github-actions-building-blocks/
steps:
- name: Checkout FLOSS
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
- name: Set up Python 3.8
uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # v4.5.0
with:
python-version: '3.8'
- name: Install dependencies
run: pip install -e .[dev]
- name: Lint with isort
run: pre-commit run isort
- name: Lint with black
run: pre-commit run black
- name: Check types with mypy
run: pre-commit run mypy
tests:
name: Tests in ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-2019, macos-11]
# across all operating systems
# version numbers are strings, not floats
python-version: ['3.8', '3.11']
include:
# on Ubuntu run these as well
- os: ubuntu-20.04
python-version: '3.9'
- os: ubuntu-20.04
python-version: '3.10'
steps:
- name: Checkout FLOSS with submodule
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
submodules: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # v4.5.0
with:
python-version: ${{ matrix.python-version }}
- name: Install pyyaml
if: matrix.os == 'ubuntu-20.04'
run: sudo apt-get install -y libyaml-dev
- name: Install FLOSS
run: pip install -e .[dev]
- name: Run tests
run: pytest tests/