ovlach_pdf/.gitea/workflows/test.yaml

63 lines
2.2 KiB
YAML
Raw Normal View History

2023-12-01 23:54:47 +00:00
name: test
run-name: test
on:
push:
branches:
- '*'
jobs:
clippy:
runs-on: ubuntu-latest
2023-12-09 15:22:22 +00:00
container:
2023-12-09 15:28:40 +00:00
image: git.nanobyte.cz/nanobyte-public/nano-rust-builder:1.74.5f84654
2023-12-01 23:54:47 +00:00
steps:
- uses: https://github.com/actions/checkout.git@v4
2023-12-09 15:22:22 +00:00
- name: Hash of Cargo.lock
id: get-hash
run: echo "::set-output name=hash::$(md5sum Cargo.lock | awk '{ print $1; }')"
2023-12-01 23:54:47 +00:00
- uses: https://gitea.com/wolfogre/cache/restore@v3
id: cache
with:
2023-12-09 15:22:22 +00:00
key: "${{github.repository}}-cache-cargo-clippy-v4-${{ steps.get-hash.outputs.hash }}"
2023-12-01 23:54:47 +00:00
path: |
.cache
target
restore-keys: ${{github.repository}}-cache-cargo-clippy-v4
- uses: nanobyte-public/rust-action@master
with:
2023-12-09 15:22:22 +00:00
args: CARGO_HOME=./.cache cargo-nan \"Bearer ${{secrets.deployment_package}}\" cargo clippy -- -Dwarnings
2023-12-01 23:54:47 +00:00
- uses: https://gitea.com/wolfogre/cache/save@v3
if: steps.cache.outputs.cache-hit != 'true'
with:
path: |
.cache
target
2023-12-09 15:22:22 +00:00
key: "${{github.repository}}-cache-cargo-clippy-v4-${{ steps.get-hash.outputs.hash }}"
2023-12-01 23:54:47 +00:00
test:
2023-12-09 15:22:22 +00:00
container:
2023-12-09 15:28:40 +00:00
image: git.nanobyte.cz/nanobyte-public/nano-rust-builder:1.74.5f84654
2023-12-01 23:54:47 +00:00
runs-on: ubuntu-latest
steps:
- uses: https://github.com/actions/checkout.git@v4
2023-12-09 15:22:22 +00:00
- name: Hash of Cargo.lock
id: get-hash
run: echo "::set-output name=hash::$(md5sum Cargo.lock | awk '{ print $1; '})"
2023-12-01 23:54:47 +00:00
- uses: https://gitea.com/wolfogre/cache/restore@v3
id: cache
with:
path: |
.cache
target
2023-12-09 15:22:22 +00:00
key: "${{github.repository}}-cache-test-clippy-v4-${{ steps.get-hash.outputs.hash }}"
restore-keys: ${{github.repository}}-cache-test-test-v4
2023-12-01 23:54:47 +00:00
- uses: nanobyte-public/rust-action@master
with:
args: |
2023-12-09 15:22:22 +00:00
CARGO_HOME=./.cache cargo-nan \"Bearer ${{secrets.deployment_package}}\" cargo test
2023-12-01 23:54:47 +00:00
- uses: https://gitea.com/wolfogre/cache/save@v3
if: steps.cache.outputs.cache-hit != 'true'
with:
path: |
.cache
target
2023-12-09 15:22:22 +00:00
key: "${{github.repository}}-cache-test-clippy-v4-${{ steps.get-hash.outputs.hash }}"