Skip to content

Commit

Permalink
Utilize make commands in github actions (#132)
Browse files Browse the repository at this point in the history
* test only cargo fmt

* add clippy and test-unit

* try to utilize cosmwasm optimizer in github action

* need to push Cargo.lock so that optimizer doesn't try to assemble it

* run e2e tests through make command

* extract tests into separate github action

* renamed compile command

* trigger workflows on release branches

Co-authored-by: Stana Miric <[email protected]>
  • Loading branch information
dusan-maksimovic and stana-miric authored Oct 4, 2024
1 parent 1303c48 commit a62b5a5
Show file tree
Hide file tree
Showing 5 changed files with 4,260 additions and 27 deletions.
28 changes: 8 additions & 20 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Rust

on:
push:
branches: [ "main" ]
branches: [ "main", "release/**", ]
paths:
- .github/workflows/rust.yml
- Cargo.toml
Expand All @@ -28,32 +28,20 @@ jobs:
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Fmt
run: cargo fmt --all -- --check
run: make fmt-check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Clippy
run: cargo clippy --all --all-targets -- -D warnings
run: make clippy
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose
test-unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Unit tests
run: cargo test --workspace --exclude test-e2e --verbose --no-fail-fast
test-e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: E2E tests
env:
E2E_TESTS_MNEMONIC: ${{ secrets.E2E_TESTS_MNEMONIC }}
run: 'cargo test e2e --verbose --no-fail-fast -- "mnemonic: $E2E_TESTS_MNEMONIC"'
WORK_DIR: ${{ github.workspace }}
run: make compile-inner
41 changes: 41 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Tests

on:
push:
branches: [ "main", "release/**", ]
paths:
- .github/workflows/tests.yml
- Cargo.toml
- Cargo.lock
- contracts/**
- packages/interface/**
- test/e2e/**
- artifacts/**
pull_request:
paths:
- .github/workflows/tests.yml
- Cargo.toml
- Cargo.lock
- contracts/**
- packages/interface/**
- test/e2e/**
- artifacts/**

env:
CARGO_TERM_COLOR: always

jobs:
test-unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Unit tests
run: make test-unit
test-e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: E2E tests
env:
E2E_TESTS_MNEMONIC: ${{ secrets.E2E_TESTS_MNEMONIC }}
run: make test-e2e
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

# Ignore project-specific files

Cargo.lock
Cargo.toml.orig

# Ignore editor-specific files
Expand Down
Loading

0 comments on commit a62b5a5

Please sign in to comment.