zoxide/.github/workflows/ci.yml

52 lines
1.5 KiB
YAML
Raw Normal View History

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
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:
os: [ubuntu-latest, windows-latest]
2021-03-29 15:44:30 +00:00
steps:
- uses: actions/checkout@dc323e67f16fb5f7663d20ff7941f27f5809e9b6 # v2.6.0
2022-02-25 04:19:45 +00:00
with:
fetch-depth: 0
2021-10-29 18:31:25 +00:00
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af # v1.0.7
2021-03-29 15:44:30 +00:00
if: ${{ matrix.os == 'windows-latest' }}
with:
2021-10-29 18:31:25 +00:00
toolchain: stable
components: rustfmt, clippy
profile: minimal
override: true
- uses: cachix/install-nix-action@d56f3ce9be45c562799280e8a561fbbe8f36de44 # v16
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
- uses: cachix/cachix-action@6a9a34cdd93d0ae4b4b59fd678660efb08109f2f # 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
uses: Swatinem/rust-cache@81d053bdb0871dcd3f10763c8cc60d0adc41762b # v1
2022-08-12 07:13:41 +00:00
with:
key: ${{ matrix.target }}
2021-10-29 18:31:25 +00:00
2021-10-11 20:05:24 +00:00
- run: cargo xtask ci
2021-10-29 18:31:25 +00:00
if: ${{ matrix.os == 'windows-latest' }}
2021-12-05 08:58:31 +00:00
- run: nix-shell --cores 0 --pure --run 'rm -rf ~/.cargo/bin; cargo xtask ci'
2021-10-29 18:31:25 +00:00
if: ${{ matrix.os != 'windows-latest' }}