-
Notifications
You must be signed in to change notification settings - Fork 4
92 lines (82 loc) · 2.82 KB
/
run-tests-externally.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
name: Test externally
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
test_externally:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
bazel: [6.x, 7.x, last_green]
bazel_mode: [workspace, module]
os: [ubuntu-latest, macos-13, macos-latest, windows-2019]
jdk: [8, 11, 17, 21]
exclude:
- bazel: 6.x
jdk: 11
- bazel: 6.x
jdk: 17
- bazel: 6.x
bazel_mode: module
- bazel: last_green
jdk: 8
- bazel: last_green
jdk: 11
- bazel: last_green
jdk: 17
- bazel_mode: workspace
jdk: 17
- bazel_mode: workspace
jdk: 21
include:
- os: ubuntu-latest
cache: "/home/runner/.cache/bazel-disk"
- os: macos-13
cache: "/private/var/tmp/bazel-disk"
- os: macos-latest
cache: "/private/var/tmp/bazel-disk"
- os: windows-2019
cache: "C:\\tmp\\bazel-disk"
- bazel_mode: module
bazel_extra_args: "--config=bzlmod"
- bazel_mode: workspace
bazel_extra_args: "--config=workspace"
name: Test externally (${{ matrix.os }}, Bazel ${{ matrix.bazel }} ${{ matrix.bazel_mode }}, JDK ${{ matrix.jdk }})
env:
BAZELISK_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ matrix.jdk }}
- name: Mount Bazel disk cache
uses: actions/cache@v4
with:
path: ${{ matrix.cache }}
key: bazel-disk-cache-${{ matrix.bazel }}-${{ matrix.os }}-${{ matrix.jdk }}
- name: Clear WORKSPACE
if: matrix.bazel_mode == 'module'
working-directory: ./tests
run: echo 'workspace(name = "fmeum_rules_jni_tests")' > WORKSPACE
- name: Run tests externally
env:
USE_BAZEL_VERSION: ${{ matrix.bazel }}
working-directory: ./tests
run: bazelisk test --config=ci --disk_cache=${{ matrix.cache }} --profile=${{ github.workspace }}/profile.gz ${{ matrix.bazel_extra_args }} //... @fmeum_rules_jni//jni/...
- name: Check coverage
if: ${{ (matrix.os == 'ubuntu-latest') && (matrix.jdk == '8' || matrix.jdk == '21') }}
env:
USE_BAZEL_VERSION: ${{ matrix.bazel }}
working-directory: ./tests
run: |
sudo apt install clang-14 llvm-14
bazelisk coverage --config=ci --disk_cache=${{ matrix.cache }} --profile=${{ github.workspace }}/profile.gz ${{ matrix.bazel_extra_args }} //...
./verify_coverage.sh