77 lines
2.1 KiB
YAML
77 lines
2.1 KiB
YAML
name: Run tests
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
cp-version:
|
|
required: true
|
|
type: string
|
|
|
|
jobs:
|
|
run:
|
|
runs-on: ubuntu-20.04
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
test: [all, mpy, native, native_mpy]
|
|
env:
|
|
CP_VERSION: ${{ inputs.cp-version }}
|
|
MICROPY_CPYTHON3: python3.8
|
|
MICROPY_MICROPYTHON: ../ports/unix/micropython-coverage
|
|
TEST_all:
|
|
TEST_mpy: --via-mpy -d basics float micropython
|
|
TEST_native: --emit native
|
|
TEST_native_mpy: --via-mpy --emit native -d basics float micropython
|
|
steps:
|
|
- name: Set up repository
|
|
uses: actions/checkout@v3
|
|
with:
|
|
submodules: false
|
|
fetch-depth: 1
|
|
- name: Set up python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: 3.x
|
|
- name: Set up submodules
|
|
uses: ./.github/actions/fetch_submodules
|
|
with:
|
|
target: tests
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y gettext
|
|
|
|
- name: Set up mpy-cross
|
|
uses: ./.github/actions/mpy_cross
|
|
|
|
- name: Build unix port
|
|
run: make -C ports/unix VARIANT=coverage -j2
|
|
|
|
- name: Test all
|
|
run: ./run-tests.py -j2 $TEST_${{ matrix.test }}
|
|
working-directory: tests
|
|
- name: Print failure info
|
|
run: ./run-tests.py -j2 --print-failures
|
|
if: failure()
|
|
working-directory: tests
|
|
|
|
- name: Set up native modules
|
|
if: matrix.test == 'all'
|
|
run: pip install -r requirements-dev.txt
|
|
- name: Build native modules
|
|
if: matrix.test == 'all'
|
|
run: |
|
|
make -C examples/natmod/features1
|
|
make -C examples/natmod/features2
|
|
make -C examples/natmod/btree
|
|
make -C examples/natmod/framebuf
|
|
make -C examples/natmod/uheapq
|
|
make -C examples/natmod/urandom
|
|
make -C examples/natmod/ure
|
|
make -C examples/natmod/uzlib
|
|
- name: Test native modules
|
|
if: matrix.test == 'all'
|
|
run: ./run-natmodtests.py extmod/{btree*,framebuf*,uheapq*,ure*,uzlib*}.py
|
|
working-directory: tests
|