-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (68 loc) · 2.02 KB
/
build-test.yml
File metadata and controls
73 lines (68 loc) · 2.02 KB
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
name: Build & Test
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
permissions:
contents: read
jobs:
prepare-env:
name: Prepare Python Virtualenv
runs-on: ubuntu-latest
container: shaymargolis/python-mips-gcc
steps:
- uses: actions/checkout@v4
- name: Set up and install dependencies
run: |
apt update && apt install -yy python3.10-venv
python -m venv .venv
. .venv/bin/activate
pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Archive virtualenv
run: tar czf venv.tar.gz .venv
- name: Upload virtualenv artifact
uses: actions/upload-artifact@v4
with:
name: python-venv
path: venv.tar.gz
lint:
name: Lint with flake8
runs-on: ubuntu-latest
container: shaymargolis/python-mips-gcc
needs: prepare-env
steps:
- uses: actions/checkout@v4
- name: Download virtualenv artifact
uses: actions/download-artifact@v4
with:
name: python-venv
- name: Extract virtualenv
run: tar xzf venv.tar.gz
- name: Lint code
run: |
. .venv/bin/activate
flake8 . --exclude .venv --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --exclude .venv --count --max-complexity=10 --max-line-length=127 --statistics
test-matrix:
name: Test on ${{ matrix.arch }}
runs-on: ubuntu-latest
needs: lint
container: shaymargolis/python-mips-gcc
strategy:
matrix:
arch: [mipsbe, mipsle, armle, x86, x86_64]
steps:
- uses: actions/checkout@v4
- name: Download virtualenv artifact
uses: actions/download-artifact@v4
with:
name: python-venv
- name: Extract virtualenv
run: tar xzf venv.tar.gz
- name: Run tests
run: |
. .venv/bin/activate
pytest --compiler-arch=${{ matrix.arch }}