Skip to content

Commit

Permalink
add ci test
Browse files Browse the repository at this point in the history
  • Loading branch information
hero78119 committed Jun 21, 2024
1 parent 580ec32 commit 30c6d28
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
53 changes: 53 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Tests

# We only run these lints on trial-merges of PRs to reduce noise.
on:
merge_group:
pull_request:
types: [synchronize, opened, reopened, ready_for_review]
push:
branches:
- master

jobs:
skip_check:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
cancel_others: 'true'
concurrent_skipping: 'same_content_newer'
paths_ignore: '["**/README.md"]'

tests:
needs: [skip_check]
if: |
github.event.pull_request.draft == false &&
(github.event.action == 'ready_for_review' || needs.skip_check.outputs.should_skip != 'true')
name: Various lints
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cargo cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: lint-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Install cargo make
run: |
cargo install --force cargo-make
- name: run test
uses: actions-rs/cargo@v1
with:
command: make
args: tests
3 changes: 2 additions & 1 deletion Makefile.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[env]
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
CORE = { script = ["grep ^cpu\\scores /proc/cpuinfo | uniq | awk '{print $4}'"] }
RAYON_NUM_THREADS = "${CORE}"

[tasks.test]
[tasks.tests]
command = "cargo"
args = ["test", "--release", "--all", "--all-features"]

0 comments on commit 30c6d28

Please sign in to comment.