ovlach_frontend/.gitea/workflows/test.yaml
2023-12-09 17:13:42 +01:00

63 lines
2.2 KiB
YAML

name: test
run-name: test
on:
push:
branches:
- '*'
jobs:
clippy:
runs-on: ubuntu-latest
container:
image: git.nanobyte.cz/nanobyte-public/nano-rust-builder:1.74.5f84654
steps:
- uses: https://github.com/actions/checkout.git@v4
- name: Hash of Cargo.lock
id: get-hash
run: echo "::set-output name=hash::$(md5sum Cargo.lock | awk '{ print $1; }')"
- uses: https://gitea.com/wolfogre/cache/restore@v3
id: cache
with:
key: "${{github.repository}}-cache-cargo-clippy-v4-${{ steps.get-hash.outputs.hash }}"
path: |
.cache
target
restore-keys: ${{github.repository}}-cache-cargo-clippy-v4
- uses: nanobyte-public/rust-action@master
with:
args: CARGO_HOME=./.cache cargo-nan \"${{secrets.deployment_package}}\" 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-${{ steps.get-hash.outputs.hash }}"
test:
container:
image: git.nanobyte.cz/nanobyte-public/nano-rust-builder:1.74.5f84654
runs-on: ubuntu-latest
steps:
- uses: https://github.com/actions/checkout.git@v4
- name: Hash of Cargo.lock
id: get-hash
run: echo "::set-output name=hash::$(md5sum Cargo.lock | awk '{ print $1; '})"
- uses: https://gitea.com/wolfogre/cache/restore@v3
id: cache
with:
path: |
.cache
target
key: "${{github.repository}}-cache-test-clippy-v4-${{ steps.get-hash.outputs.hash }}"
restore-keys: ${{github.repository}}-cache-test-test-v4
- uses: nanobyte-public/rust-action@master
with:
args: |
CARGO_HOME=./.cache cargo-nan \"Bearer ${{secrets.deployment_package}}\" 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-test-clippy-v4-${{ steps.get-hash.outputs.hash }}"