circuitpython/.github/workflows/run-tests.yml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

67 lines
1.9 KiB
YAML
Raw Normal View History

name: Run tests
2023-02-10 09:17:51 -05:00
on:
workflow_call:
inputs:
cp-version:
required: true
type: string
jobs:
run:
2023-03-04 03:37:38 -05:00
runs-on: ubuntu-22.04
2023-02-10 09:17:51 -05:00
strategy:
fail-fast: false
matrix:
test: [all, mpy, native, native_mpy]
env:
CP_VERSION: ${{ inputs.cp-version }}
MICROPY_CPYTHON3: python3.8
2023-10-05 17:00:19 -04:00
MICROPY_MICROPYTHON: ../ports/unix/build-coverage/micropython
2023-02-10 09:17:51 -05:00
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:
2023-03-04 03:37:38 -05:00
python-version: 3.8
2023-02-10 09:17:51 -05:00
- name: Set up submodules
2023-02-11 01:30:27 -05:00
uses: ./.github/actions/deps/submodules
2023-02-10 09:17:51 -05:00
with:
target: tests
2023-02-11 01:30:27 -05:00
- name: Set up external
2023-02-13 00:12:24 -05:00
if: matrix.test == 'all'
2023-02-11 01:30:27 -05:00
uses: ./.github/actions/deps/external
2023-02-10 09:17:51 -05:00
- name: Set up mpy-cross
uses: ./.github/actions/mpy_cross
2023-10-05 17:00:19 -04:00
with:
cp-version: ${{ inputs.cp-version }}
2023-02-10 09:17:51 -05:00
- name: Build unix port
run: make -C ports/unix VARIANT=coverage -j2
2023-02-11 01:30:27 -05:00
- name: Run tests
run: ./run-tests.py -j2 ${{ env[format('TEST_{0}', matrix.test)] }}
2023-02-10 09:17:51 -05:00
working-directory: tests
- name: Print failure info
run: ./run-tests.py -j2 --print-failures
if: failure()
working-directory: tests
- name: Build native modules
if: matrix.test == 'all'
run: |
make -C examples/natmod/features1
make -C examples/natmod/features2
make -C examples/natmod/heapq
make -C examples/natmod/random
make -C examples/natmod/re
2023-02-10 09:17:51 -05:00
- name: Test native modules
if: matrix.test == 'all'
run: ./run-natmodtests.py extmod/{heapq*,re*,zlib*}.py
2023-02-10 09:17:51 -05:00
working-directory: tests