-
Notifications
You must be signed in to change notification settings - Fork 45
170 lines (138 loc) · 4.97 KB
/
Copy pathnix.yaml
File metadata and controls
170 lines (138 loc) · 4.97 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: Nix
on:
push:
branches:
- main
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
NIX_DEVELOP: ${{ github.workspace }}
defaults:
run:
shell: bash --noprofile --norc -eo pipefail -c "nix develop $NIX_DEVELOP --command bash --noprofile --norc -eo pipefail $1" -- {0}
jobs:
flake-check:
runs-on: ubuntu-latest
name: nix flake check
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v22
with:
summarize: false
- uses: DeterminateSystems/magic-nix-cache-action@v13
- run: nix flake check -L
test:
runs-on: ubuntu-latest
name: Tests (JDK ${{ matrix.java }})
env:
NIX_DEVELOP: ${{ github.workspace }}#jdk${{ matrix.java }}
strategy:
fail-fast: false
matrix:
java: [17, 21, 25]
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v22
with:
summarize: false
- uses: DeterminateSystems/magic-nix-cache-action@v13
- name: Main project tests
run: gradle test --no-daemon
bazel:
runs-on: ubuntu-latest
name: Bazel (${{ matrix.name }})
strategy:
fail-fast: false
matrix:
include:
- name: scip-java
directory: .
javac_option: "--//scip-javac:enabled=true"
aggregator_target: "scip-aggregator:bazel"
- name: bazel-example
directory: examples/bazel-example
javac_option: "--@scip_java//scip-javac:enabled=true"
aggregator_target: "@scip_java//scip-aggregator:bazel"
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v22
with:
summarize: false
- uses: DeterminateSystems/magic-nix-cache-action@v13
- run: bazelisk build //... ${{ matrix.javac_option }}
working-directory: ${{ matrix.directory }}
- run: bazelisk run ${{ matrix.aggregator_target }} -- --sourceroot "$PWD"
working-directory: ${{ matrix.directory }}
- run: du -h index.scip
working-directory: ${{ matrix.directory }}
bazel_aspect:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v22
with:
summarize: false
- uses: DeterminateSystems/magic-nix-cache-action@v13
- run: gradle :scip-java:installDist --no-daemon
- run: printf 'SCIP_JAVA_CLI=%s\n' "$PWD/scip-java/build/install/scip-java/bin/scip-java" >> "$GITHUB_ENV"
- name: Auto-index scip-java codebase
run: |
"$SCIP_JAVA_CLI" index --build-tool=bazel --bazel-scip-java-binary="$SCIP_JAVA_CLI"
- run: du -h index.scip
- name: Auto-index example/bazel-workspace
run: |
"$SCIP_JAVA_CLI" index --build-tool=bazel --bazel-scip-java-binary="$SCIP_JAVA_CLI"
working-directory: examples/bazel-example
- run: du -h index.scip
working-directory: examples/bazel-example
snapshots:
runs-on: ubuntu-latest
name: Snapshots
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v22
with:
summarize: false
- uses: DeterminateSystems/magic-nix-cache-action@v13
- name: Regenerate snapshots
run: gradle :scip-snapshots:saveSnapshots --no-daemon
- name: Check snapshot drift
run: |
git diff --exit-code \
scip-snapshots/expected
maven:
runs-on: ubuntu-latest
name: Maven tests (JDK ${{ matrix.java }})
env:
NIX_DEVELOP: ${{ github.workspace }}#jdk${{ matrix.java }}
strategy:
fail-fast: false
matrix:
java: [17, 21, 25]
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v22
with:
summarize: false
- uses: DeterminateSystems/magic-nix-cache-action@v13
- run: |
gradle --no-daemon :scip-java:installDist publishToMavenLocal
SCIP_JAVA_VERSION="$(
sed -n 's/^version:=//p' scip-java/build/install/scip-java/VERSION
)"
test -n "$SCIP_JAVA_VERSION"
printf 'SCIP_JAVA_VERSION=%s\n' "$SCIP_JAVA_VERSION" >> "$GITHUB_ENV"
printf 'SCIP_JAVA_CLI=%s\n' "$PWD/scip-java/build/install/scip-java/bin/scip-java" >> "$GITHUB_ENV"
- run: mvn clean verify -DskipTests "-Dscip-java.version=$SCIP_JAVA_VERSION" sourcegraph:sourcegraphDependencies
working-directory: examples/maven-example
- run: |
"$SCIP_JAVA_CLI" aggregate target/scip-targetroot
working-directory: examples/maven-example
- run: |
grep org.hamcrest target/scip-targetroot/*dependencies.txt
grep "$PWD/src/main/java" target/scip-targetroot/*dependencies.txt
working-directory: examples/maven-example
- run: du -h index.scip
working-directory: examples/maven-example