Setup CI #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Cache Deps | |
id: cache-deps | |
uses: actions/cache@v3 | |
with: | |
path: build-cache | |
key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('.pre-commit-config.yaml') }}-${{ hashFiles('dev.docker') }} | |
- name: Pull and build deps | |
if: steps.cache-primes.outputs.cache-hit != 'true' | |
run: make build-dev | |
test: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Restore cache | |
id: cache-deps | |
uses: actions/cache/restore@v3 | |
with: | |
path: build-cache | |
key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('.pre-commit-config.yaml') }}-${{ hashFiles('dev.docker') }} | |
- name: Run tests | |
run: make test | |
pre-commit: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Restore cache | |
id: cache-deps | |
uses: actions/cache/restore@v3 | |
with: | |
path: build-cache | |
key: ${{ runner.os }}-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('.pre-commit-config.yaml') }}-${{ hashFiles('dev.docker') }} | |
- name: Run pre-commit | |
run: make pre-commit-all |