Skip to content

[Misc]: Push test 5 #14

[Misc]: Push test 5

[Misc]: Push test 5 #14

Workflow file for this run

name: Linux CI Rust
on:
push:
branches: [ dev, master ]
pull_request:
branches: [ dev, master ]
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
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
upload-binary-sizes:
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v3
- name: Upload binary sizes
uses: actions/upload-artifact@v2
with:
name: registry_json
path: registry.json
check-binary-sizes:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v3
- name: Download previous artifact
id: download_prev_artifact
uses: dawidd6/action-download-artifact@v3
with:
commit: ${{github.event.pull_request.base.sha}}
path: prev
if_no_artifact_found: warn
- name: Find Comment
if: steps.download_prev_artifact.outputs.found_artifact == 'true'
uses: peter-evans/find-comment@v1
id: binary_size_comment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Binary size comparison
- name: Craft Comment Body
if: steps.download_prev_artifact.outputs.found_artifact == 'true'
id: compute_sizes
run: |
echo "size_before=$( du -k prev/registry.json | cut -f1 )" >> $GITHUB_OUTPUT
echo "size_after=$( du -k registry.json | cut -f1 )" >> $GITHUB_OUTPUT
- name: Create or Update Comment
if: steps.download_prev_artifact.outputs.found_artifact == 'true'
uses: peter-evans/create-or-update-comment@v1
with:
comment-id: ${{ steps.find_comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
**Binary size comparison**:
```diff
- registry.json ${{ steps.compute_sizes.outputs.size_before }}
+ registry.json ${{ steps.compute_sizes.outputs.size_after }}
```