(cargo-release) version 0.8.0 #917
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
name: ci | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
env: | |
CARGO_INCREMENTAL: 0 | |
RUSTFLAGS: "-Dwarnings" | |
CARGO_UNSTABLE_SPARSE_REGISTRY: true | |
jobs: | |
lint: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt | |
- uses: r7kamura/rust-problem-matchers@v1 | |
- run: cargo fmt --all -- --check | |
- uses: xt0rted/markdownlint-problem-matcher@v2 | |
- uses: DavidAnson/markdownlint-cli2-action@v13 | |
with: | |
globs: "**/*.md" | |
deny: | |
strategy: | |
matrix: | |
check: | |
- advisories | |
- bans licenses sources | |
runs-on: ubuntu-22.04 | |
needs: | |
- "lint" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: "true" | |
- uses: EmbarkStudios/cargo-deny-action@v1 | |
with: | |
command: check ${{ matrix.check }} | |
sort: | |
runs-on: ubuntu-22.04 | |
needs: | |
- "lint" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- run: cargo install cargo-sort | |
- run: cargo sort --workspace --check >/dev/null | |
clippy: | |
runs-on: ubuntu-22.04 | |
needs: | |
- "lint" | |
strategy: | |
matrix: | |
rust: | |
- stable | |
- beta | |
# Prevent beta warnings from causing CI failure | |
continue-on-error: ${{ matrix.rust == 'beta' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: mobilecoinfoundation/actions/dcap-libs@main | |
with: | |
version: 1.16.100.2-jammy1 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
components: clippy | |
- uses: r7kamura/rust-problem-matchers@v1 | |
- run: cargo +${{ matrix.rust }} clippy --all --all-features -- -D warnings -Aclippy::incorrect_clone_impl_on_copy_type | |
build: | |
runs-on: ubuntu-22.04 | |
needs: | |
- "lint" | |
strategy: | |
matrix: | |
rust: | |
- stable | |
- beta | |
- nightly-2022-12-13 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: mobilecoinfoundation/actions/sgxsdk@main | |
with: | |
version: 2.19.100.3 | |
- uses: mobilecoinfoundation/actions/dcap-libs@main | |
with: | |
version: 1.16.100.2-jammy1 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
- uses: r7kamura/rust-problem-matchers@v1 | |
- run: cargo +${{ matrix.rust }} build --release --locked | |
build-all-features: | |
runs-on: ubuntu-22.04 | |
needs: | |
- "lint" | |
strategy: | |
matrix: | |
rust: | |
- stable | |
- beta | |
- nightly-2022-12-13 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: mobilecoinfoundation/actions/sgxsdk@main | |
with: | |
version: 2.19.100.3 | |
- uses: mobilecoinfoundation/actions/dcap-libs@main | |
with: | |
version: 1.16.100.2-jammy1 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
- uses: r7kamura/rust-problem-matchers@v1 | |
- run: cargo +${{ matrix.rust }} build --release --locked --all-features | |
test: | |
runs-on: ubuntu-22.04 | |
needs: | |
- "lint" | |
strategy: | |
matrix: | |
rust: | |
- stable | |
- beta | |
- nightly-2022-12-13 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: mobilecoinfoundation/actions/sgxsdk@main | |
with: | |
version: 2.19.100.3 | |
- uses: mobilecoinfoundation/actions/dcap-libs@main | |
with: | |
version: 1.16.100.2-jammy1 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
- uses: r7kamura/rust-problem-matchers@v1 | |
- name: Run tests | |
# For some reason `SGX_AESM_ADDR` is set to 1 in the github runners. | |
# Not seeing it documented here, https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2004-Readme.md | |
# We can't just set to 0 or "" as the SGX code looks for it being set, not what the value is :( | |
run: unset SGX_AESM_ADDR && cargo +${{ matrix.rust }} test --release --features "sim alloc" --locked | |
doc: | |
runs-on: ubuntu-22.04 | |
needs: | |
- "lint" | |
strategy: | |
matrix: | |
rust: | |
- stable | |
- beta | |
# Prevent beta warnings from causing CI failure | |
continue-on-error: ${{ matrix.rust == 'beta' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ matrix.rust }} | |
- uses: r7kamura/rust-problem-matchers@v1 | |
- run: cargo +${{ matrix.rust }} doc --release --no-deps --features sim | |
coverage: | |
runs-on: ubuntu-22.04 | |
needs: | |
- "lint" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: mobilecoinfoundation/actions/sgxsdk@main | |
with: | |
version: 2.19.100.3 | |
- uses: mobilecoinfoundation/actions/dcap-libs@main | |
with: | |
version: 1.16.100.2-jammy1 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: llvm-tools-preview | |
- uses: taiki-e/install-action@cargo-llvm-cov | |
- name: Run tests with coverage | |
# For some reason `SGX_AESM_ADDR` is set to 1 in the github runners. | |
# Not seeing it documented here, https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2004-Readme.md | |
# We can't just set to 0 or "" as the SGX code looks for it being set, not what the value is :( | |
# The FFI bindings crates always report 100% because they have no code | |
run: unset SGX_AESM_ADDR && cargo llvm-cov --locked --features sim --ignore-filename-regex '\/sys/src/lib\.rs' --workspace --lcov --output-path lcov.info | |
- uses: codecov/codecov-action@v3 | |
with: | |
files: lcov.info | |
# This job ensures that the specified crates are able to build without alloc. By proxy this also ensures that they | |
# build with no_std | |
build-no-alloc: | |
runs-on: ubuntu-22.04 | |
needs: | |
- "lint" | |
strategy: | |
matrix: | |
target: | |
- thumbv6m-none-eabi | |
- thumbv7m-none-eabi | |
- thumbv8m.main-none-eabi | |
- aarch64-linux-android | |
- aarch64-apple-ios | |
- wasm32-unknown-unknown | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: nightly-2022-12-13 | |
targets: ${{ matrix.target }},x86_64-unknown-linux-gnu | |
components: rust-src | |
- uses: r7kamura/rust-problem-matchers@v1 | |
- name: Build types with no alloc crate on various platforms | |
# In the unlikely event that the target was installed with rustup, this would error out with duplicate core | |
# symbols due to `-Z build-std=core`. | |
run: | | |
cargo metadata --no-deps --format-version=1 | \ | |
jq -r '.packages[].name' | \ | |
grep -e types | \ | |
xargs -n1 sh -c 'cargo +nightly-2022-12-13 build -Z build-std=core --target ${{ matrix.target }} -p $0 --locked || exit 255' | |
notify: | |
runs-on: ubuntu-latest | |
if: failure() && ${{ github.event_name }} == 'push' | |
needs: | |
- "lint" | |
- "deny" | |
- "sort" | |
- "clippy" | |
- "build" | |
- "build-no-alloc" | |
- "test" | |
- "doc" | |
- "coverage" | |
steps: | |
- name: Notify Discord on failure | |
uses: sarisia/actions-status-discord@v1 | |
with: | |
username: "Github Actions" | |
status: Failure | |
nodetail: true | |
title: "Workflow: ${{ github.workflow }}" | |
url: ${{ github.repository_url }}/actions/runs/${{ github.run_id }} | |
description: | | |
[@${{ github.pusher }}](${{ github.url }}/${{ github.pusher }}] was the last one to touch ${{ github.repository }}, is all I'm saying... | |
avatar_url: "https://media0.giphy.com/media/oe33xf3B50fsc/200.gif" | |
webhook: ${{ secrets.DISCORD_WEBHOOK }} |