2023 Day 3 Part 2 #89
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: CI | |
on: | |
pull_request: | |
# run jobs on merges to main, allowing PR branches to see shared caches | |
push: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | |
jobs: | |
solomonhawk-build: | |
if: github.ref == 'refs/heads/main' || startsWith(github.head_ref, 'sfh/') | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: solomonhawk/2022 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rust-lang/[email protected] | |
with: | |
cache: false | |
- uses: Swatinem/rust-cache@v1 | |
with: | |
key: v1 # increment this to bust the cache if needed | |
working-directory: solomonhawk/2022 | |
- name: Run build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release --manifest-path solomonhawk/2022/Cargo.toml | |
- name: Run AoC | |
uses: actions-rs/cargo@v1 | |
with: | |
command: run | |
args: --manifest-path solomonhawk/2022/Cargo.toml --release | |
solomonhawk-test: | |
if: github.ref == 'refs/heads/main' || startsWith(github.head_ref, 'sfh/') | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: solomonhawk/2022 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions-rust-lang/[email protected] | |
with: | |
cache: false | |
- uses: Swatinem/rust-cache@v1 | |
with: | |
key: v1 # increment this to bust the cache if needed | |
working-directory: solomonhawk/2022 | |
- uses: taiki-e/install-action@nextest | |
- name: Run Tests | |
uses: actions-rs/cargo@v1 | |
with: | |
command: nextest | |
args: run --all --manifest-path solomonhawk/2022/Cargo.toml |