Skip to content

WIP commit

WIP commit #1

# Workflow triggered by pushes to the main branch and PRs targeting it

Check failure on line 1 in .github/workflows/deployment-build-test.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/deployment-build-test.yaml

Invalid workflow file

(Line: 66, Col: 28): Unrecognized named-value: 'step'. Located at position 1 within expression: step.build.outputs.DEPLOYMENT_SIZE
# (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}\`\`\``
})