-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (44 loc) · 1.46 KB
/
tests-static.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
name: build-static
on:
push:
paths:
- .github/workflows/**
- requirements.txt
- tests/**
jobs:
parse-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- name: Parse matrix
id: set-matrix
run: |
matrix=$(jq -c . < .github/workflows/matrix.json)
echo "matrix=${matrix}" >> $GITHUB_OUTPUT
build:
needs: parse-matrix
runs-on: ${{ matrix.os }}
strategy:
matrix: ${{fromJson(needs.parse-matrix.outputs.matrix)}}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Check file existence
id: check_files
uses: andstor/file-existence-action@v2
with:
files: "requirements.txt"
- name: Install Package (fixed requirements)
if: steps.check_files.outputs.files_exists == 'true'
run: |
pip install pytest
pip install -r requirements.txt
pip freeze
- name: Run tests
if: steps.check_files.outputs.files_exists == 'true'
run: python -m pytest .