2021-03-29 15:44:30 +00:00
|
|
|
name: ci
|
|
|
|
on:
|
|
|
|
push:
|
2023-01-06 20:01:49 +00:00
|
|
|
branches: [main]
|
2021-03-29 15:44:30 +00:00
|
|
|
pull_request:
|
2021-10-29 18:31:25 +00:00
|
|
|
workflow_dispatch:
|
2022-04-25 09:15:46 +00:00
|
|
|
env:
|
|
|
|
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
|
|
|
|
CARGO_INCREMENTAL: 0
|
2022-05-19 11:07:25 +00:00
|
|
|
CARGO_TERM_COLOR: always
|
2023-03-18 13:52:41 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
2021-03-29 15:44:30 +00:00
|
|
|
jobs:
|
|
|
|
ci:
|
2021-10-29 18:31:25 +00:00
|
|
|
name: ${{ matrix.os }}
|
2021-03-29 15:44:30 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-03-31 11:20:29 +00:00
|
|
|
os: [ubuntu-latest, windows-latest]
|
2021-03-29 15:44:30 +00:00
|
|
|
steps:
|
2023-05-05 07:54:44 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-02-25 04:19:45 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2023-05-05 07:54:44 +00:00
|
|
|
- uses: actions-rs/toolchain@v1
|
2021-03-29 15:44:30 +00:00
|
|
|
if: ${{ matrix.os == 'windows-latest' }}
|
|
|
|
with:
|
2023-05-05 21:46:13 +00:00
|
|
|
components: clippy
|
|
|
|
profile: minimal
|
2021-10-29 18:31:25 +00:00
|
|
|
toolchain: stable
|
2023-05-05 21:46:13 +00:00
|
|
|
- uses: actions-rs/toolchain@v1
|
|
|
|
if: ${{ matrix.os == 'windows-latest' }}
|
|
|
|
with:
|
|
|
|
components: rustfmt
|
2021-10-29 18:31:25 +00:00
|
|
|
profile: minimal
|
2023-05-05 21:46:13 +00:00
|
|
|
toolchain: nightly
|
2023-05-05 07:54:44 +00:00
|
|
|
- uses: cachix/install-nix-action@v20
|
2021-03-29 15:44:30 +00:00
|
|
|
if: ${{ matrix.os != 'windows-latest' }}
|
|
|
|
with:
|
2022-04-25 09:15:46 +00:00
|
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
2023-05-05 07:54:44 +00:00
|
|
|
- uses: cachix/cachix-action@v12
|
2022-04-25 09:15:46 +00:00
|
|
|
if: ${{ matrix.os != 'windows-latest' && env.CACHIX_AUTH_TOKEN != '' }}
|
|
|
|
with:
|
|
|
|
authToken: ${{ env.CACHIX_AUTH_TOKEN }}
|
|
|
|
name: zoxide
|
|
|
|
- name: Setup cache
|
2023-05-15 22:43:28 +00:00
|
|
|
uses: Swatinem/rust-cache@v2.3.0
|
2022-08-12 07:13:41 +00:00
|
|
|
with:
|
2023-05-05 07:54:44 +00:00
|
|
|
key: ${{ matrix.os }}
|
2023-05-05 21:46:13 +00:00
|
|
|
- name: Install just
|
|
|
|
uses: taiki-e/install-action@v2
|
|
|
|
with:
|
|
|
|
tool: just
|
2023-05-06 15:18:19 +00:00
|
|
|
- name: Run lints + tests
|
|
|
|
run: just lint test
|