Skip to content

Test 2

Test 2 #30

Workflow file for this run

name: Linux CI Rust
on:
push:
branches: [ dev, master ]
pull_request:
branches: [ dev, master ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# Check formatting, clippy warnings, run tests and check code coverage.
build-and-test:
permissions:
contents: read
checks: write
runs-on: ubuntu-latest
if: false
steps:
- uses: actions/checkout@v3
- name: Install system dependencies
run: |
tools/install-sys-dependencies-linux
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
key: "build-and-test"
workspaces: |
rust
- name: Install Rust dependencies
run: |
tools/install-rust-dependencies dev
- name: Check code formatting
run: |
cargo fmt --check
working-directory: rust
- name: Check Clippy warnings
run: |
cargo clippy -- -D warnings
working-directory: rust
- name: Run tests
run: |
cargo llvm-cov nextest --profile ci --no-fail-fast --lcov --output-path coverage.info
working-directory: rust
- name: Rust Test Report
uses: dorny/test-reporter@v1
if: success() || failure()
continue-on-error: true
with:
name: Rust Tests
path: |
rust/target/nextest/ci/junit.xml
reporter: java-junit
- name: Gather and check Rust code coverage
run: |
tools/check-coverage rust/coverage.stats rust/coverage.info
# Run Rust tests in WASM.
test-wasm:
runs-on: ubuntu-latest
if: false
steps:
- uses: actions/checkout@v3
- name: Install system dependencies
run: |
tools/install-sys-dependencies-linux
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
key: "test-wasm"
workspaces: |
rust
- name: Install Rust dependencies
run: |
tools/install-rust-dependencies
- name: Install emsdk
run: tools/install-wasm-dependencies
- name: Run tests in WASM
run: tools/rust-test wasm
check-binary-sizes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
# TODO remove this step
- name: Install toolchain
run: |
rustup target add armv7-linux-androideabi
- name: Build binaries
run: |
cargo build --target armv7-linux-androideabi --release
working-directory: rust-test
- name: Generate release report
run: |
./tools/release-size measure-rust > release-report.json
- name: Upload release report
uses: actions/upload-artifact@v2
with:
name: release_report_1
path: release-report.json
# Download previous release report, compare the release binary sizes and post/update a comment in the Pull Request.
- name: Download previous release report
if: github.event_name == 'pull_request'
uses: dawidd6/action-download-artifact@v3
with:
commit: ${{github.event.pull_request.base.sha}}
path: previous
if_no_artifact_found: warn
# Same artifact name as at the "Upload release report" step.
name: release_report_1
- name: Craft Comment Body
if: github.event_name == 'pull_request'
run: |
# Please note `previous/release-report.json` may not exist if the previous report was not found.
./tools/release-size compare previous/release-report.json release-report.json > report-diff.md
- name: Create or Update Comment
uses: edumserrano/find-create-or-update-comment@v2
with:
issue-number: ${{ github.event.pull_request.number }}
body-includes: "Binary size comparison"
comment-author: 'github-actions[bot]'
edit-mode: replace
body-path: 'report-diff.md'