aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/run-all-tests.yml
blob: 7bd18a928bb160b81415e296f7a61e8882b84e0f (plain)
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
name: Build all targets and run all tests

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

  workflow_dispatch:

jobs:

  build_and_test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest]
        jdk: [8, 16]
        include:
          - os: ubuntu-latest
            arch: "linux"
            cache: "/home/runner/.cache/bazel-disk"
          - os: macos-latest
            arch: "darwin"
            cache: "/private/var/tmp"
          - jdk: 8
            jdk8_flag: "--//third_party/jni:jdk_8"
          - jdk: 16
            jdk8_flag: "--no//third_party/jni:jdk_8"

    steps:
      - uses: actions/checkout@v2

      - name: Set up JDK
        uses: actions/setup-java@v1
        with:
          java-version: ${{ matrix.jdk }}

      - name: Mount Bazel disk cache
        uses: actions/cache@v2
        with:
          path: ${{ matrix.cache }}
          key: bazel-disk-cache-${{ matrix.arch }}-${{ matrix.jdk }}

      - name: Download Bazelisk for macOS
        if: matrix.arch == 'darwin'
        run: curl -LO https://github.com/bazelbuild/bazelisk/releases/download/v1.7.5/bazelisk-darwin-amd64 && chmod +x bazelisk-darwin-amd64

      - name: Build
        run: ./bazelisk-${{ matrix.arch }}-amd64 build --disk_cache=${{ matrix.cache }} -c opt ${{ matrix.jdk8_flag }} //...

      - name: Test
        run: ./bazelisk-${{ matrix.arch }}-amd64 test --disk_cache=${{ matrix.cache }} -c opt ${{ matrix.jdk8_flag }} --test_tag_filters="-broken-on-${{ matrix.arch }}" //...

      - name: Upload test logs
        if: always()
        uses: actions/upload-artifact@v2
        with:
          name: testlogs-${{ matrix.arch }}-${{ matrix.jdk }}
          # https://github.com/actions/upload-artifact/issues/92#issuecomment-711107236
          path: bazel-testlogs*/**/test.log