Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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 }}
40 changes: 0 additions & 40 deletions .github/workflows/python-app.yml

This file was deleted.