all platforms: update Mycelium dependencies #954
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Lovingly borrowed from mycelium's CI setup | |
name: CI | |
on: | |
# always run CI on pushes to PRs and to the `main` branch | |
pull_request: | |
push: | |
branches: ["main"] | |
# allow manually triggering CI. | |
workflow_dispatch: | |
# enable merge queue. | |
merge_group: | |
env: | |
# disable incremental compilation. | |
# | |
# incremental compilation is useful as part of an edit-build-test-edit cycle, | |
# as it lets the compiler avoid recompiling code that hasn't changed. however, | |
# on CI, we're not making small edits; we're almost always building the entire | |
# project from scratch. thus, incremental compilation on CI actually | |
# introduces *additional* overhead to support making future builds | |
# faster...but no future builds will ever occur in any given CI environment. | |
# | |
# see https://matklad.github.io/2021/09/04/fast-rust-builds.html#ci-workflow | |
# for details. | |
CARGO_INCREMENTAL: 0 | |
# allow more retries for network requests in cargo (downloading crates) and | |
# rustup (installing toolchains). this should help to reduce flaky CI failures | |
# from transient network timeouts or other issues. | |
CARGO_NET_RETRY: 10 | |
CARGO_TERM_COLOR: always | |
RUSTUP_MAX_RETRIES: 10 | |
# don't emit giant backtraces in the CI logs. | |
RUST_BACKTRACE: short | |
jobs: | |
# dummy job to indicate everything has passed. | |
# | |
# this is used to gate merging branches, rather than requiring the individual | |
# checks in the GitHub branch protection UI. this allows us to declare which | |
# jobs gate merging in this file, rather than out of band in the UI. | |
all_systems_go: | |
name: "all systems go!" | |
runs-on: ubuntu-latest | |
needs: | |
- check | |
- clippy | |
- build-bins | |
- build-x86_64 | |
- test | |
- test-host-miri | |
- docs | |
- rustfmt | |
- netlify_dryrun | |
steps: | |
- run: exit 0 | |
# run `just check` | |
check: | |
name: just check | |
# needs: changed_paths | |
# if: needs.changed_paths.outputs.should_skip != 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- name: install libudev | |
run: sudo apt-get update && sudo apt-get install -y libudev-dev | |
- uses: actions/checkout@v2 | |
- name: rust toolchain | |
run: rustup show | |
- uses: olix0r/cargo-action-fmt@ee1ef42932e44794821dab57ef1bf7a73df8b21f | |
- uses: extractions/setup-just@v1 | |
- name: run just check | |
run: just check | |
# run `just clippy` | |
clippy: | |
name: just clippy | |
# needs: changed_paths | |
# if: needs.changed_paths.outputs.should_skip != 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- name: install libudev | |
run: sudo apt-get update && sudo apt-get install -y libudev-dev | |
- uses: actions/checkout@v2 | |
- name: rust toolchain | |
run: rustup show | |
- uses: olix0r/cargo-action-fmt@ee1ef42932e44794821dab57ef1bf7a73df8b21f | |
- uses: extractions/setup-just@v1 | |
- name: run just clippy | |
run: just clippy | |
# build bin targets | |
build-bins: | |
strategy: | |
matrix: | |
package: ["mnemos-d1", "mnemos-esp32c3-buddy", "mnemos-x86_64"] | |
name: cargo build ${{ matrix.package }} | |
runs-on: ubuntu-latest | |
needs: check | |
steps: | |
- uses: actions/checkout@v2 | |
- name: rust toolchain | |
run: rustup show | |
- uses: olix0r/cargo-action-fmt@ee1ef42932e44794821dab57ef1bf7a73df8b21f | |
# note that this actually *needs* to be `--release`, because the D1 platform | |
# impl apparently just Does Not Build in debug mode (debug builds fail with | |
# a pile of linker errors, what the heck...) | |
- run: cargo build --package ${{ matrix.package}} --release --all-features | |
# build x86_64 bootimage | |
build-x86_64: | |
runs-on: ubuntu-latest | |
needs: check | |
steps: | |
- uses: actions/checkout@v2 | |
- name: rust toolchain | |
run: rustup show | |
- uses: extractions/setup-just@v1 | |
- run: just build-x86 | |
# run `just test` | |
test: | |
name: just test | |
needs: check # skip on commits that don't compile. | |
# needs: changed_paths | |
# if: needs.changed_paths.outputs.should_skip != 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- name: install libudev and libsdl2-dev | |
run: | | |
sudo apt-get update \ | |
&& sudo apt-get install -y libudev-dev libsdl2-dev | |
- uses: actions/checkout@v2 | |
- name: rust toolchain | |
run: rustup show | |
- name: install nextest | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: cargo-nextest@latest | |
- uses: extractions/setup-just@v1 | |
- name: just test | |
run: just test | |
# (test-host forth3) - run miri tests | |
test-host-miri: | |
runs-on: ubuntu-latest | |
name: cargo miri test --package forth3 (host) | |
needs: check | |
# TODO(eliza): only run this if forth3 changed? | |
# needs: changed_paths | |
# if: needs.changed_paths.outputs.should_skip != 'true' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: rust toolchain | |
run: rustup show | |
- name: install Miri | |
run: | | |
rustup component add miri | |
cargo miri setup | |
- name: cargo miri test (forth3) | |
run: | | |
cargo miri test \ | |
--package forth3 \ | |
--all-features | |
# check code style with `rustfmt` | |
rustfmt: | |
# needs: changed_paths | |
# if: needs.changed_paths.outputs.should_skip != 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: install rust toolchain | |
run: rustup show | |
- name: run rustfmt | |
run: cargo fmt --check | |
# check that RustDoc builds | |
# | |
# See `check` NOTE above for details regarding the excluded crate(s). | |
docs: | |
# needs: changed_paths | |
# if: needs.changed_paths.outputs.should_skip != 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- name: install libudev | |
run: sudo apt-get update && sudo apt-get install -y libudev-dev | |
- uses: actions/checkout@v2 | |
- name: rust toolchain | |
run: rustup show | |
- uses: olix0r/cargo-action-fmt@ee1ef42932e44794821dab57ef1bf7a73df8b21f | |
- uses: extractions/setup-just@v1 | |
- name: run rustdoc | |
run: just docs --document-private-items | |
# check that netlify CI should work | |
netlify_dryrun: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: install netlify deps | |
run: ./scripts/install-ci-deps.sh | |
- name: run netlify ci | |
run: ./scripts/run-ci-build.sh |