Workflow file for this run
This file contains hidden or 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
| # Workflow triggered by pushes to the main branch and PRs targeting it | ||
|
Check failure on line 1 in .github/workflows/deployment-build-test.yaml
|
||
| # (as long as the commits contain code changes). | ||
| name: Check formatting, build and run tests for deployment project | ||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened, ready_for_review] | ||
| paths: | ||
| - '.github/workflows/deployment-build-test.yaml' | ||
| - 'concordium-base' | ||
| - 'deployment' | ||
| env: | ||
| CARGO_TERM_COLOR: always # implicitly adds '--color=always' to all cargo commands | ||
| jobs: | ||
| rustfmt: | ||
| name: lint:fmt | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| submodules: recursive | ||
| - name: Run rustfmt | ||
| working-directory: deployment | ||
| run: | | ||
| rustup component add rustfmt | ||
| cargo fmt -- --check | ||
| lint_clippy_test: | ||
| name: lint:clippy | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
| - name: Clippy | ||
| working-directory: deployment | ||
| run: | | ||
| rustup component add clippy | ||
| cargo clippy --all-targets --all-features -- -D warnings | ||
| - name: Test | ||
| working-directory: deployment | ||
| run: cargo test --all-targets --all-features | ||
| # Build the deployment unit to WebAssembly and report the size in bytes | ||
| report_wasm_size: | ||
| name: Report output byte size of Wasm deployment unit | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| submodules: recursive | ||
| - name: Build to WebAssembly | ||
| id: build | ||
| working-directory: deployment | ||
| run: | | ||
| cargo build --release --target wasm32-unknown-unknown | ||
| echo "DEPLOYMENT_SIZE=$(du -b target/wasm32-unknown-unknown/release/deployment.wasm)" >> "$GITHUB_OUTPUT" | ||
| - name: Attach size to PR | ||
| uses: actions/github-script@v8.0.0 | ||
| env: | ||
| DEPLOYMENT_SIZE: ${{step.build.outputs.DEPLOYMENT_SIZE}} | ||
| with: | ||
| github-token: ${{secrets.GITHUB_TOKEN}} | ||
| script: | | ||
| github.rest.issues.createComment({ | ||
| issue_number: context.issue.number, | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| body: `\`\`\`du -b target/wasm32-unknown-unknown/release/deployment.wasm:\n ${env.DEPLOYMENT_SIZE}\`\`\`` | ||
| }) | ||