Skip to content

Initial support for the Rust Embedded embedded-hal #763

Initial support for the Rust Embedded embedded-hal

Initial support for the Rust Embedded embedded-hal #763

Workflow file for this run

# This workflow provides automated testing. It builds and runs tests on each PR.
name: ci
# We want to run CI on all pull requests. Additionally, GitHub actions merge
# queue needs workflows to run on the `merge_queue` trigger to block merges on
# them.
on:
pull_request:
merge_group:
jobs:
ci:
# Using ubuntu-latest can cause breakage when ubuntu-latest is updated to
# point at a new Ubuntu version. Instead, explicitly specify the version, so
# we can update when we need to. This *could* break if we don't update it
# until support for this version is dropped, but it is likely we'll have a
# reason to update to a newer Ubuntu before then anyway.
runs-on: ubuntu-22.04
steps:
# Clones a single commit from the libtock-rs repository. The commit cloned
# is a merge commit between the PR's target branch and the PR's source.
# Note that we checkout submodules so that we can invoke Tock's CI setup
# scripts, but we do not recursively checkout submodules as we need Tock's
# makefile to set up the qemu submodule itself.
- name: Clone repository
uses: actions/checkout@v3
with:
submodules: true
# The main test step. We let the makefile do most of the work because the
# makefile can be tested locally. We experimentally determined that -j2 is
# optimal for the Azure Standard_DS2_v2 VM, which is the VM type used by
# GitHub Actions at the time of this writing.
#
# We have to append the "-D warnings" flag to .cargo/config rather than
# using the RUSTFLAGS environment variable because if we set RUSTFLAGS
# cargo will ignore the rustflags config in .cargo/config, breaking
# relocation.
- name: Build and Test
run: |
sudo apt-get install ninja-build
cd "${GITHUB_WORKSPACE}"
echo "[target.'cfg(all())']" >> .cargo/config
echo 'rustflags = ["-D", "warnings"]' >> .cargo/config
make -j2 setup
make -j2 test