Skip to content

Commit

Permalink
Merge pull request #6 from apollodao/dev/fix-stuff
Browse files Browse the repository at this point in the history
Add tests, fix bugs, and refactor
  • Loading branch information
apollo-sturdy authored Sep 29, 2023
2 parents b2c9905 + 71714a7 commit 0da48cb
Show file tree
Hide file tree
Showing 57 changed files with 6,570 additions and 1,381 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/
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
33 changes: 33 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Coverage

on:
push:
branches:
- master
pull_request:

env:
RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always

jobs:
coverage:
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 Rust
run: cargo make install-stable

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

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: target/coverage/lcov.info
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
22 changes: 11 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ 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.65.0
target: wasm32-unknown-unknown
override: true
run: cargo make install-stable

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

- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --locked --lib
- name: Run integration tests
run: cargo make integration-test
env:
RUST_BACKTRACE: 1
Loading

0 comments on commit 0da48cb

Please sign in to comment.