-
Notifications
You must be signed in to change notification settings - Fork 3
88 lines (84 loc) · 2.92 KB
/
workflow.yaml
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Continuous integration
on:
push:
branches: main
pull_request:
branches: main
workflow_dispatch: # allows manual triggering
schedule:
- cron: '1 11 * * *'
env:
# Bump this number to invalidate the GH actions cache
cache-version: 0
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
jobs:
test-nixpkgs:
name: Build & Test - Nixpkgs
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
ghc-version: ["ghc_8_10_7", "ghc_9_0_2", "ghc_9_2_5", "ghc_9_4_5", "ghc_9_6_5", "ghc_9_8_1"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Mount Bazel cache
uses: actions/cache@v4
with:
path: ~/repo-cache
key: repo-cache-${{ runner.os }}-nixpkgs-${{ env.cache-version }}
- uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=./nixpkgs.nix
- uses: tweag/configure-bazel-remote-cache-auth@v0
with:
buildbuddy_api_key: ${{ secrets.BUILDBUDDY_API_KEY }}
bazelrc_path: .bazelrc.local
- name: Configure
run: |
cat >>.bazelrc.local <<EOF
build --host_platform=@io_tweag_rules_nixpkgs//nixpkgs/platforms:host
build --config=remote-cache
build --repository_cache=~/repo-cache/
EOF
ln -s ../.bazelrc.local example/.bazelrc.local
ln -s ../../.bazelrc.local tests/alternative-deps/.bazelrc.local
- name: Build & test himportscan
uses: tweag/run-nix-shell@v0
with:
run: bazel test //himportscan:tasty --config=${{ matrix.ghc-version }}
- name: Build & run gazelle
uses: tweag/run-nix-shell@v0
with:
working-directory: example
run: bazel run //:gazelle --config=${{ matrix.ghc-version }}
- name: Build & run gazelle fix
uses: tweag/run-nix-shell@v0
with:
working-directory: example
run: bazel run //:gazelle --config=${{ matrix.ghc-version }} -- fix
- name: Build & test generated rules
uses: tweag/run-nix-shell@v0
with:
working-directory: example
run: bazel test //... --config=${{ matrix.ghc-version }}
- name: Build & run gazelle with alternative dependencies
uses: tweag/run-nix-shell@v0
with:
working-directory: tests/alternative-deps
run: bazel run //:gazelle --config=${{ matrix.ghc-version }}
- name: Test for buildifier suggestions
uses: tweag/run-nix-shell@v0
with:
run: bazel run //:buildifier-diff
all_ci_tests:
runs-on: ubuntu-latest
needs:
- test-nixpkgs
if: ${{ always() }}
steps:
- uses: cgrindel/gha_join_jobs@8a9736c29a7e5ebd9f3af2870f59cb6d563b6659 # v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}