Skip to content

Merge pull request #394 from alphaville/feature/github-actions #510

Merge pull request #394 from alphaville/feature/github-actions

Merge pull request #394 from alphaville/feature/github-actions #510

Workflow file for this run

name: Continuous integration
on:
push:
branches: [master]
pull_request:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
rust_tests:
name: Rust tests (${{ matrix.name }})
runs-on: ${{ matrix.os }}
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
include:
- name: Linux
os: ubuntu-latest
- name: macOS
os: macos-latest
steps:
- uses: actions/checkout@v5
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
rustflags: ""
- name: Cargo tests
run: cargo test
- name: Cargo tests (RP and JEM)
run: |
cargo test --features rp
cargo test --features jem
python_tests:
name: Python tests (${{ matrix.name }})
needs: rust_tests
runs-on: ${{ matrix.os }}
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
include:
- name: Linux
os: ubuntu-latest
skip_rpi_test: 0
- name: macOS
os: macos-latest
skip_rpi_test: 1
env:
DO_DOCKER: 0
SKIP_RPI_TEST: ${{ matrix.skip_rpi_test }}
steps:
- uses: actions/checkout@v5
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
components: clippy
rustflags: ""
- uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: open-codegen/setup.py
- uses: egor-tensin/setup-clang@v1
if: runner.os == 'Linux'
- name: Install Linux ARM target
if: runner.os == 'Linux'
run: rustup target add arm-unknown-linux-gnueabihf
- name: Install ARM cross-compiler and C libraries
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y gcc-arm-linux-gnueabihf libc6-dev-armhf-cross
- name: Install LLVM
if: runner.os == 'macOS'
run: brew install llvm
- name: Run Python tests and generated Clippy checks
if: runner.os == 'Linux'
env:
CC_arm_unknown_linux_gnueabihf: arm-linux-gnueabihf-gcc
AR_arm_unknown_linux_gnueabihf: arm-linux-gnueabihf-ar
run: bash ./ci/script.sh python-tests
- name: Run Python tests and generated Clippy checks
if: runner.os == 'macOS'
run: bash ./ci/script.sh python-tests
ocp_tests:
name: OCP tests (${{ matrix.name }})
needs: python_tests
runs-on: ${{ matrix.os }}
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
include:
- name: Linux
os: ubuntu-latest
- name: macOS
os: macos-latest
env:
DO_DOCKER: 0
steps:
- uses: actions/checkout@v5
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
rustflags: ""
- uses: actions/setup-python@v6
with:
python-version: "3.12"
cache: "pip"
cache-dependency-path: open-codegen/setup.py
- name: Run OCP Python tests
run: bash ./ci/script.sh ocp-tests