-
Notifications
You must be signed in to change notification settings - Fork 12
79 lines (69 loc) · 2.16 KB
/
ci.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
name: CI-2
on: [ push, pull_request, workflow_dispatch ]
env:
BASE_JAVA: 11
BASE_OS: ubuntu-latest
jobs:
tests:
name: Build & test on ${{ matrix.os }} with Java ${{ matrix.java }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
java: [ 11, 21 ]
steps:
- uses: actions/checkout@v3
- name: Setup Redis
shell: bash
# It seems there's no straightforward way to install a recent redis version on Windows, so
# let's only consider macOS & Ubuntu for RedisStore tests.
run: |
if [[ "${{ matrix.os }}" == macos* ]]
then
brew install redis
elif [[ "${{ matrix.os }}" == ubuntu* ]]
then
chmod +x install-redis-ubuntu.sh
./install-redis-ubuntu.sh
fi
- name: Run tests
uses: ./.github/actions/run-gradle
if: "!startsWith(matrix.os, 'macos')"
with:
java: ${{ matrix.java }}
gradle-args: check
# Brotli is not currently supported on macOS so related tests are excluded there.
- name: Run tests
uses: ./.github/actions/run-gradle
if: startsWith(matrix.os, 'macos')
with:
java: ${{ matrix.java }}
gradle-args: check -x :methanol-brotli:test
- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ matrix.os }}-java-${{ matrix.java }}-test-results
path: |
'**/build/test-results/'
'**/build/**/*.exec'
coverage:
name: Upload coverage report
needs: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download test results
uses: actions/download-artifact@v4
with:
name: ${{ env.BASE_OS }}-java-${{ env.BASE_JAVA }}-test-results
- name: Generate coverage report
uses: ./.github/actions/run-gradle
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
with:
java: ${{ env.BASE_JAVA }}
gradle-args: coveralls