-
-
Notifications
You must be signed in to change notification settings - Fork 21
55 lines (43 loc) · 1.62 KB
/
lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: lint
on:
pull_request:
push:
branches: [main]
merge_group:
jobs:
pre-commit:
strategy:
matrix:
os: [["ubuntu-latest"], ["self-hosted", "macOS"]]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/880992dcc006a5e00dd0591446fdf723e6a51a64.tar.gz # keep in sync with shell.nix
- name: Wait for nix daemon to start
if: runner.os == 'macOS'
run: wait4path /nix/var/nix/profiles/per-user
- name: Initialize nix environment
run: nix-shell --run true
- name: Setup backend pypackages cache
uses: actions/cache@v3
with:
path: |
backend/__pypackages__/
key: ${{ runner.os }}-${{ runner.arch }}-pypackages-${{ hashFiles('backend/pdm.lock', 'proto/transcribee_proto/*.py') }}
- name: Setup worker pypackages cache
uses: actions/cache@v3
with:
path: |
worker/__pypackages__/
key: ${{ runner.os }}-${{ runner.arch }}-pypackages-${{ hashFiles('worker/pdm.lock', 'proto/transcribee_proto/*.py') }}
- name: install dependencies
run: nix-shell --run ./packaging/install_dependencies.sh
- name: cache pre-commit env
uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: ${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('.pre-commit-config.yaml') }}
- name: run pre-commit
run: nix-shell --run 'pre-commit run --show-diff-on-failure --color=always --all-files'