This commit is contained in:
Ondrej Vlach 2023-12-02 00:54:47 +01:00
parent b51840d09a
commit 7ea9bbbb5f
Signed by: ovlach
GPG Key ID: 4FF1A23B4914DE70

View File

@ -0,0 +1,53 @@
name: test
run-name: test
on:
workflow_call:
push:
branches:
- '*'
jobs:
clippy:
runs-on: ubuntu-latest
steps:
- uses: https://github.com/actions/checkout.git@v4
- uses: https://gitea.com/wolfogre/cache/restore@v3
id: cache
with:
path: |
.cache
target
key: ${{github.repository}}-cache-cargo-clippy-v4-${{ hashFiles('Cargo.lock') }}
restore-keys: ${{github.repository}}-cache-cargo-clippy-v4
- uses: nanobyte-public/rust-action@master
with:
args: CARGO_HOME=./.cache cargo clippy -- -Dwarnings
- uses: https://gitea.com/wolfogre/cache/save@v3
if: steps.cache.outputs.cache-hit != 'true'
with:
path: |
.cache
target
key: ${{github.repository}}-cache-cargo-clippy-v4-${{ hashFiles('Cargo.lock') }}
test:
runs-on: ubuntu-latest
steps:
- uses: https://github.com/actions/checkout.git@v4
- uses: https://gitea.com/wolfogre/cache/restore@v3
id: cache
with:
path: |
.cache
target
key: ${{github.repository}}-cache-cargo-test-v4-${{ hashFiles('Cargo.lock') }}
restore-keys: ${{github.repository}}-cache-cargo-test-v4
- uses: nanobyte-public/rust-action@master
with:
args: |
CARGO_HOME=./.cache cargo test
- uses: https://gitea.com/wolfogre/cache/save@v3
if: steps.cache.outputs.cache-hit != 'true'
with:
path: |
.cache
target
key: ${{github.repository}}-cache-cargo-test-v4-${{ hashFiles('Cargo.lock') }}