Skip to content

Commit

Permalink
ci: Update workflows and configs
Browse files Browse the repository at this point in the history
  • Loading branch information
apollo-sturdy committed Sep 15, 2023
1 parent 3d8f29c commit ff48f7b
Show file tree
Hide file tree
Showing 19 changed files with 1,354 additions and 1,095 deletions.
11 changes: 0 additions & 11 deletions .editorconfig

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Artifacts

on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main
workflow_dispatch:

env:
RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always

jobs:
artifacts:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install cargo make
uses: davidB/rust-cargo-make@v1

- name: Compile contracts to wasm
run: cargo make rust-optimizer

- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: artifacts
path: artifacts/
4 changes: 1 addition & 3 deletions .github/workflows/cc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
name: Conventional commit check
on:
pull_request:
branches:
- master
workflow_dispatch:

# This workflow denies a push to master if all pushed commits are not following
# This workflow denies a push on a pull request if all pushed commits are not following
# the conventional commits standard.

jobs:
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v3

- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
args: --all-features
- name: Install cargo make
uses: davidB/rust-cargo-make@v1

- name: Install stable Rust
run: cargo make install-stable

- name: Check
run: cargo make check
39 changes: 16 additions & 23 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,33 @@
name: Test coverage
name: Coverage

on:
pull_request:
push:
branches:
- master
workflow_dispatch:
pull_request:

env:
RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings

jobs:
coverage:
name: Check unit test coverage
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
target: wasm32-unknown-unknown
override: true
- name: Install cargo make
uses: davidB/rust-cargo-make@v1

- name: Install tarpaulin
uses: actions-rs/cargo@v1
with:
toolchain: nightly
command: install
args: cargo-tarpaulin --version 0.20.1
- name: Install stable Rust
run: cargo make install-stable

- name: Run test coverage
run: cargo make coverage-lcov

- name: Run code coverage check with tarpaulin
uses: actions-rs/cargo@v1
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
toolchain: nightly
command: tarpaulin
args: --lib --workspace --timeout 120
token: ${{ secrets.CODECOV_TOKEN }}
files: target/coverage/lcov.info
39 changes: 0 additions & 39 deletions .github/workflows/integration_tests.yml

This file was deleted.

10 changes: 4 additions & 6 deletions .github/workflows/licenses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install cargo make
uses: davidB/rust-cargo-make@v1

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.59.0
target: wasm32-unknown-unknown
override: true
run: cargo make install-stable

- name: run cargo deny
uses: EmbarkStudios/cargo-deny-action@v1
Expand Down
33 changes: 8 additions & 25 deletions .github/workflows/lint-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,20 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install cargo make
uses: davidB/rust-cargo-make@v1

- name: Install nightly toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rustfmt, clippy

- name: Install cargo-machete
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-machete
run: cargo make install-nightly

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
toolchain: nightly
command: clippy
args: --all-features -- -D warnings
run: cargo make clippy-check

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
toolchain: nightly
command: fmt
args: --all -- --check --verbose
run: cargo make format-check

- name: Run cargo machete
uses: actions-rs/cargo@v1
with:
command: machete
run: cargo make machete-check

- name: Lint todo comments
run: ./scripts/todo-lint.sh
run: cargo make todo-check
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test Suite
on:
pull_request:
workflow_dispatch:

env:
RUSTFLAGS: -D warnings

jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install cargo make
uses: davidB/rust-cargo-make@v1

- name: Install stable toolchain
run: cargo make install-stable

- name: Run unit tests
run: cargo make unit-test
env:
RUST_BACKTRACE: 1

- name: Run integration tests
run: cargo make integration-test
env:
RUST_BACKTRACE: 1
31 changes: 0 additions & 31 deletions .github/workflows/unit_tests.yml

This file was deleted.

Loading

0 comments on commit ff48f7b

Please sign in to comment.