Skip to content

Commit

Permalink
Enable initial CI jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
atodorov committed Oct 11, 2023
1 parent d05c12c commit f33922b
Showing 1 changed file with 91 additions and 0 deletions.
91 changes: 91 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
---
name: CI

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [main, testnet, dev]
pull_request:

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

permissions: read-all

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
fmt:
name: Rustfmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
override: true
components: rustfmt

- name: Check formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
target: wasm32-unknown-unknown
profile: minimal
override: true
components: clippy
- uses: Swatinem/rust-cache@v2

- name: Run Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --all-features -- -D warnings -A clippy::too_many_arguments -A clippy::type_complexity

check:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
target: wasm32-unknown-unknown
profile: minimal
override: true
- uses: Swatinem/rust-cache@v2

- name: Check Build
run: |
SKIP_WASM_BUILD=1 cargo check --release
- name: Check Build for Benchmarking
run: |
SKIP_WASM_BUILD=1 cargo check --features=runtime-benchmarks --release
shellcheck:
name: "🐚 Shellcheck"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@2.0.0
env:
SHELLCHECK_OPTS: -e SC2002 # allow useless cat commands

0 comments on commit f33922b

Please sign in to comment.