|
| 1 | +# ref: https://github.com/actions/runner-images |
1 | 2 | name: build_and_test |
2 | 3 |
|
3 | 4 | # Controls when the action will run. |
4 | | -on: |
5 | | - # Triggers the workflow on push or pull request events but only for the master branch |
6 | | - push: |
7 | | - branches: [ master ] |
8 | | - pull_request: |
9 | | - branches: [ master ] |
10 | | - # Allows you to run this workflow manually from the Actions tab |
11 | | - workflow_dispatch: |
| 5 | +on: [push, pull_request, workflow_dispatch] |
12 | 6 |
|
13 | 7 | env: |
14 | 8 | PIP_BREAK_SYSTEM_PACKAGES: 1 |
15 | 9 |
|
16 | 10 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel |
17 | 11 | jobs: |
18 | | - |
19 | 12 | unix: |
20 | 13 | strategy: |
21 | 14 | fail-fast: false |
22 | 15 | matrix: |
23 | 16 | runs-on: [ubuntu-latest] |
24 | 17 | build_tool: [bazel, cmake] |
25 | 18 |
|
26 | | - name: "${{matrix.runs-on}} ${{matrix.build_tool}}" |
| 19 | + name: "script ${{matrix.build_tool}}" |
27 | 20 | runs-on: ${{matrix.runs-on}} |
28 | 21 |
|
29 | 22 | # Steps represent a sequence of tasks that will be executed as part of the job |
30 | 23 | steps: |
31 | 24 | - name: Show env |
32 | 25 | run: env |
33 | | - |
34 | 26 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
35 | | - - uses: actions/checkout@v3 |
| 27 | + - uses: actions/checkout@v4 |
36 | 28 |
|
37 | | - - name: Install bazel |
| 29 | + - name: Setup bazel |
38 | 30 | if: matrix.build_tool == 'bazel' |
39 | | - # Install Bazel, see https://docs.bazel.build/versions/master/install-ubuntu.html#step-1-install-required-packages |
40 | | - run: | |
41 | | - sudo apt install curl gnupg |
42 | | - curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg |
43 | | - sudo mv bazel.gpg /etc/apt/trusted.gpg.d/ |
44 | | - echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list |
45 | | - sudo apt update && sudo apt install bazel -y |
| 31 | + uses: bazel-contrib/[email protected] |
| 32 | + with: |
| 33 | + bazelisk-cache: true |
| 34 | + disk-cache: ${{ github.workflow }} |
| 35 | + repository-cache: true |
46 | 36 |
|
47 | 37 | - name: Show bazel version |
48 | 38 | if: matrix.build_tool == 'bazel' |
49 | 39 | run: bazel --version |
50 | 40 |
|
51 | | - - name: Update cmake |
52 | | - if: matrix.build_tool == 'cmake' |
53 | | - |
54 | | - |
55 | 41 | - name: Show cmake version |
56 | 42 | if: matrix.build_tool == 'cmake' |
57 | 43 | run: cmake --version |
|
0 commit comments