-
-
Notifications
You must be signed in to change notification settings - Fork 352
172 lines (154 loc) · 5.27 KB
/
tests.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
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
171
172
# Workflow for testing Spoon.
#
# Note that actions are specified by commit hash. This is to avoid the security
# risk of someone injecting malicious code into a release and then simply
# changing a tag.
name: tests
on:
pull_request:
branches:
- master
push:
branches:
- master
- chore/flakey-flakey-rise-and-shine
schedule:
- cron: "0 0 * * *"
env:
MAVEN_OPTS: >-
-Dmaven.resolver.transport=native
-Daether.connector.connectTimeout=300000
-Daether.connector.requestTimeout=300000
NIX_OPTIONS: >-
--ignore-environment
--keep MAVEN_OPTS --keep PATH --keep LANG
jobs:
test-linux:
runs-on: ${{ matrix.os }}
name: Tests with Java ${{ matrix.java }} on ${{ matrix.os }}
strategy:
matrix:
java: [17, 21]
os: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: Setup env
uses: ./.github/actions/setup-tests
- name: Time nix setup
run: nix develop .#jdk${{ matrix.java }} ${{ env.NIX_OPTIONS }} --command true
- name: Test
run: nix develop .#jdk${{ matrix.java }} ${{ env.NIX_OPTIONS }} --command test
test-windows:
runs-on: windows-latest
name: Tests with Java 17 on windows-latest
steps:
- name: Disable Git's autocrlf
run: git config --global core.autocrlf false
- name: git checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'maven'
- name: Test
run: |
cp chore/logback.xml src/test/resources/
mvn -f spoon-pom test
cat testResults.spoon
coverage:
runs-on: ubuntu-latest
name: Test with coverage
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: Setup env
uses: ./.github/actions/setup-tests
- name: Time nix setup
run: nix develop ${{ env.NIX_OPTIONS }} --command true
- name: Run tests with coverage
run: nix develop ${{ env.NIX_OPTIONS }} --keep PR_NUMBER --keep GITHUB_TOKEN --command coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.number }}
extra:
runs-on: ubuntu-latest
name: Extra checks
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: Setup env
uses: ./.github/actions/setup-tests
- name: Time nix setup
run: nix develop ${{ env.NIX_OPTIONS }} .#extraChecks --command true
- name: Run extra checks
run: nix develop ${{ env.NIX_OPTIONS }} .#extraChecks --command extra
- name: Trigger extra remote tasks
if: github.repository == 'INRIA/spoon' && github.event_name == 'pull_request'
run: nix develop ${{ env.NIX_OPTIONS }} .#extraChecks --command extra-remote
javadoc:
runs-on: ubuntu-latest
name: Javadoc quality
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: Setup env
uses: ./.github/actions/setup-tests
- name: Time nix setup
run: nix develop ${{ env.NIX_OPTIONS }} .#extraChecks --command true
- name: Build spoon
run: nix develop ${{ env.NIX_OPTIONS }} .#extraChecks --command mvn -f spoon-pom -B install -Dmaven.test.skip=true
- name: Run Javadoc quality check
run: nix develop ${{ env.NIX_OPTIONS }} .#extraChecks --command javadoc-quality
reproducible-builds:
runs-on: ubuntu-latest
name: reproducible-builds
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: Setup env
uses: ./.github/actions/setup-tests
- name: Time nix setup
run: nix develop ${{ env.NIX_OPTIONS }} --command true
- name: Check status
run: nix develop ${{ env.NIX_OPTIONS }} --command reproducible-builds
maven-central-requirements:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: Setup env
uses: ./.github/actions/setup-tests
- name: Time nix setup
run: nix develop ${{ env.NIX_OPTIONS }} --command true
- name: Check maven pom quality
run: nix develop ${{ env.NIX_OPTIONS }} --command maven-pom-quality
codegen:
runs-on: ubuntu-latest
name: Codegeneration
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: Setup env
uses: ./.github/actions/setup-tests
- name: Time nix setup
run: nix develop ${{ env.NIX_OPTIONS }} --command true
- name: Run codegen checks
run: nix develop ${{ env.NIX_OPTIONS }} --command codegen