Skip to content

Commit 3db1995

Browse files
committed
ci: use nix to run mypy type checks
The setup of the notmuch and gpg dependencies is quite complex and takes a long time so it is easier to have nix prepare the environment in which to run the type checks.
1 parent b4e287f commit 3db1995

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

.github/workflows/check.yml

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,13 @@ jobs:
3434
runs-on: ubuntu-latest
3535

3636
steps:
37-
- uses: actions/checkout@v4
38-
39-
- name: Set up Python
40-
uses: actions/setup-python@v5
41-
with:
42-
python-version: "3.12"
37+
- name: Install Nix
38+
uses: cachix/install-nix-action@v22
4339

44-
- name: Install dependencies
45-
run: |
46-
pip install mypy
47-
pip install -e .[typing]
40+
- uses: actions/checkout@v4
4841

4942
- name: Run type checking
50-
run: mypy --ignore-missing-imports alot/errors.py alot/__init__.py alot/utils/cached_property.py
43+
run: 'nix build --print-build-logs .\#checks.x86_64-linux.types'
5144

5245

5346
nix-flake:
@@ -61,13 +54,13 @@ jobs:
6154
- alot.man
6255

6356
steps:
64-
- name: Install Nix
65-
uses: cachix/install-nix-action@v22
57+
- name: Install Nix
58+
uses: cachix/install-nix-action@v22
6659

67-
- uses: actions/checkout@v4
60+
- uses: actions/checkout@v4
6861

69-
- name: Build the ${{ matrix.derivation }} derivation
70-
run: 'nix build --print-build-logs .\#${{ matrix.derivation }}'
62+
- name: Build the ${{ matrix.derivation }} derivation
63+
run: 'nix build --print-build-logs .\#${{ matrix.derivation }}'
7164

7265

7366
generated-docs:

0 commit comments

Comments
 (0)