Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configuration | github actions #74

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: CI
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
jobs:
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# cancel concurrent builds on the same branch
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: false

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2022-04-24
components: rustfmt, llvm-tools-preview
target: wasm32-unknown-unknown
default: true

- name: Cache restore
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Clean
if: ${{ github.event.inputs.CLEAN_BUILD == 'true' }}
run: cargo clean

- name: Check format
run: cargo fmt --all -- --check

- name: Check release
run: cargo check --release

- name: Build
run: cargo build --release

- name: Test
run: cargo test --release

- name: Benchmarking
run: cargo test --features runtime-benchmarks