Add caching

This commit is contained in:
Joel Wachsler 2022-07-11 02:07:48 +02:00
parent b5df2944b5
commit e617f8c662
2 changed files with 45 additions and 20 deletions

View File

@ -5,26 +5,6 @@ on:
- '**'
- '!main'
jobs:
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install latest stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
- name: Run cargo check
uses: actions-rs/cargo@v1
with:
command: check
- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
test:
runs-on: ubuntu-22.04
services:
@ -35,13 +15,57 @@ jobs:
- 8080:8080
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v2
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('Cargo.lock') }}
- name: Install latest stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace
fmt:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install latest stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
override: true
- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
clippy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install latest stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: clippy
override: true
- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings

View File

@ -46,6 +46,7 @@ jobs:
with:
toolchain: stable
profile: minimal
override: true
- name: Login
uses: actions-rs/cargo@v1