Skip to content

Commit 182a8f7

Browse files
committed
nix: added cachix workflow
1 parent 38dd6e9 commit 182a8f7

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
name: ci
2-
32
on:
43
push:
54
branches:
6-
- main
5+
- main
76
pull_request:
87
branches:
9-
- main
10-
8+
- main
119
jobs:
1210
Test:
1311
runs-on: ubuntu-24.04
@@ -16,78 +14,65 @@ jobs:
1614
uses: actions/checkout@v4
1715
with:
1816
fetch-depth: 0
19-
2017
- name: Create Cache Timestamp
2118
id: cache_timestamp
2219
uses: nanzm/[email protected]
2320
with:
2421
format: 'YYYY-MM-DD-HH-mm-ss'
25-
2622
- name: Mount bazel cache
2723
uses: actions/cache@v4
2824
with:
2925
path: "~/.cache/bazel"
3026
key: bazelcache_test_${{ steps.cache_timestamp.outputs.time }}
3127
restore-keys: bazelcache_test_
32-
3328
- name: Test
3429
run: |
3530
export CC=gcc-13
3631
export CXX=g++-13
3732
bazel test --noshow_progress --keep_going ...
38-
3933
MacOsBuild:
4034
runs-on: macos-latest
4135
steps:
4236
- name: Checkout code
4337
uses: actions/checkout@v4
4438
with:
4539
fetch-depth: 0
46-
4740
- name: Test
4841
run: |
4942
bazel test --noshow_progress --keep_going ...
50-
5143
- name: Build
5244
run: |
5345
bazel build --noshow_progress -c opt //fpga:fpga-as
54-
5546
CodeFormatting:
5647
runs-on: ubuntu-24.04
5748
steps:
5849
- name: Checkout code
5950
uses: actions/checkout@v4
6051
with:
6152
fetch-depth: 0
62-
6353
- name: Install Dependencies
6454
run: |
6555
sudo apt-get install clang-format-17
66-
6756
- name: Run formatting style check
6857
run: |
6958
clang-format-17 --version
7059
RUNNING_IN_CI=1 CLANG_FORMAT=clang-format-17 \
7160
scripts/run-clang-format.sh
72-
7361
ClangTidy:
7462
runs-on: ubuntu-24.04
7563
steps:
7664
- name: Checkout code
7765
uses: actions/checkout@v4
7866
with:
7967
fetch-depth: 0
80-
8168
- name: Install Dependencies
8269
run: |
8370
sudo apt-get install clang-tidy-18
84-
8571
- name: Create Cache Timestamp
8672
id: cache_timestamp
8773
uses: nanzm/[email protected]
8874
with:
8975
format: 'YYYY-MM-DD-HH-mm-ss'
90-
9176
- name: Mount clang-tidy cache
9277
uses: actions/cache@v4
9378
with:
@@ -96,13 +81,24 @@ jobs:
9681
~/.cache/bazel
9782
key: clang-tidy-cache_${{ steps.cache_timestamp.outputs.time }}
9883
restore-keys: clang-tidy-cache_
99-
10084
- name: Build Compilation DB
10185
run: |
10286
scripts/make-compilation-db.sh
103-
10487
- name: Run clang-tidy
10588
run: |
10689
clang-tidy-18 --version
10790
CLANG_TIDY=clang-tidy-18 scripts/run-clang-tidy-cached.cc \
10891
|| ( cat fpga-assembler_clang-tidy.out ; exit 1)
92+
NixBuild:
93+
runs-on: ubuntu-latest
94+
steps:
95+
- uses: actions/checkout@v4
96+
- uses: cachix/install-nix-action@v25
97+
with:
98+
nix_path: nixpkgs=channel:nixos-unstable
99+
- uses: cachix/cachix-action@v15
100+
with:
101+
name: mycache
102+
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
103+
- run: nix-build
104+
- run: nix-shell --run "echo OK"

0 commit comments

Comments
 (0)