Skip to content

Commit d1d751e

Browse files
committed
github: workflows: Organize and make build&test better
1 parent f3d0a5e commit d1d751e

2 files changed

Lines changed: 72 additions & 40 deletions

File tree

.github/workflows/build-test.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Build & Test
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
prepare-env:
14+
name: Prepare Python Virtualenv
15+
runs-on: ubuntu-latest
16+
container: shaymargolis/python-mips-gcc
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Set up and install dependencies
20+
run: |
21+
python -m venv .venv
22+
. .venv/bin/activate
23+
pip install --upgrade pip
24+
pip install flake8 pytest
25+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
26+
- name: Archive virtualenv
27+
run: tar czf venv.tar.gz .venv
28+
- name: Upload virtualenv artifact
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: python-venv
32+
path: venv.tar.gz
33+
34+
lint:
35+
name: Lint with flake8
36+
runs-on: ubuntu-latest
37+
needs: prepare-env
38+
container: shaymargolis/python-mips-gcc
39+
steps:
40+
- uses: actions/checkout@v4
41+
- name: Download virtualenv artifact
42+
uses: actions/download-artifact@v4
43+
with:
44+
name: python-venv
45+
- name: Extract virtualenv
46+
run: tar xzf venv.tar.gz
47+
- name: Lint code
48+
run: |
49+
. .venv/bin/activate
50+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
51+
flake8 . --count --max-complexity=10 --max-line-length=127 --statistics
52+
53+
test-matrix:
54+
name: Test on ${{ matrix.arch }}
55+
runs-on: ubuntu-latest
56+
needs: lint
57+
container: shaymargolis/python-mips-gcc
58+
strategy:
59+
matrix:
60+
arch: [mipsbe, mipsle, armle, x86, x86_64]
61+
steps:
62+
- uses: actions/checkout@v4
63+
- name: Download virtualenv artifact
64+
uses: actions/download-artifact@v4
65+
with:
66+
name: python-venv
67+
- name: Extract virtualenv
68+
run: tar xzf venv.tar.gz
69+
- name: Run tests
70+
run: |
71+
. .venv/bin/activate
72+
pytest --compiler-arch=${{ matrix.arch }}

.github/workflows/python-app.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)