Skip to content

Commit ab040d6

Browse files
authored
Move CI workflow into ci.yml (#136)
1 parent 47ae73d commit ab040d6

7 files changed

Lines changed: 107 additions & 49 deletions

File tree

.bazelrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
common --enable_platform_specific_config
2+
3+
common --check_direct_dependencies=off
4+
5+
common:linux --repo_env=CC=clang
6+
common:windows --enable_runfiles
7+
18
# Avoid https://github.com/bazelbuild/bazel/issues/14459 since we don't need Xcode
29
common --repo_env=BAZEL_USE_CPP_ONLY_TOOLCHAIN=1
310

.github/actions/build_and_test/action.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 92 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI for PR Merge
1+
name: CI
22

33
on:
44
pull_request:
@@ -8,28 +8,103 @@ on:
88
- cron: '3 11 * * *'
99

1010
jobs:
11-
macos_build:
12-
runs-on: macos-latest
11+
build:
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
os: [macos-latest, ubuntu-latest, windows-latest]
16+
bazel_version: ['9.x', rolling]
17+
runs-on: ${{ matrix.os }}
18+
env:
19+
USE_BAZEL_VERSION: ${{ matrix.bazel_version }}
1320
steps:
1421
- uses: actions/checkout@v2
15-
- uses: ./.github/actions/build_and_test
16-
with:
17-
github_token: ${{ secrets.GITHUB_TOKEN }}
22+
- name: Execute Tests
23+
shell: bash
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
run: bazelisk test //...
27+
- name: Execute Integration Tests
28+
shell: bash
29+
# Bazel-in-Bazel still has issues with runfiles
30+
if: runner.os != 'Windows'
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
run: bazelisk test //:all_integration_tests
1834

19-
ubuntu_build:
20-
runs-on: ubuntu-latest
35+
example_simple:
36+
strategy:
37+
fail-fast: false
38+
matrix:
39+
os: [macos-latest, ubuntu-latest, windows-latest]
40+
bazel_version: ['7.x', '8.x']
41+
runs-on: ${{ matrix.os }}
42+
env:
43+
USE_BAZEL_VERSION: ${{ matrix.bazel_version }}
44+
steps:
45+
- uses: actions/checkout@v2
46+
- name: Test
47+
shell: bash
48+
working-directory: examples/simple
49+
run: bazelisk test //...
50+
51+
example_specify_assets:
52+
strategy:
53+
fail-fast: false
54+
matrix:
55+
os: [macos-latest, ubuntu-latest, windows-latest]
56+
bazel_version: ['7.x', '8.x']
57+
runs-on: ${{ matrix.os }}
58+
env:
59+
USE_BAZEL_VERSION: ${{ matrix.bazel_version }}
60+
steps:
61+
- uses: actions/checkout@v2
62+
- name: Test
63+
shell: bash
64+
working-directory: examples/specify_assets
65+
run: bazelisk test //...
66+
67+
example_bzlmod:
68+
strategy:
69+
fail-fast: false
70+
matrix:
71+
os: [macos-latest, ubuntu-latest, windows-latest]
72+
bazel_version: ['7.x', '8.x', '9.x', rolling]
73+
runs-on: ${{ matrix.os }}
2174
env:
22-
CC: clang
75+
USE_BAZEL_VERSION: ${{ matrix.bazel_version }}
2376
steps:
2477
- uses: actions/checkout@v2
25-
- uses: ./.github/actions/build_and_test
26-
with:
27-
github_token: ${{ secrets.GITHUB_TOKEN }}
78+
- name: Test
79+
shell: bash
80+
working-directory: examples/bzlmod
81+
run: bazelisk test //...
2882

29-
windows_build:
30-
runs-on: windows-latest
83+
example_bzlmod_specify_assets:
84+
strategy:
85+
fail-fast: false
86+
matrix:
87+
os: [macos-latest, ubuntu-latest, windows-latest]
88+
bazel_version: ['9.x', rolling]
89+
runs-on: ${{ matrix.os }}
90+
env:
91+
USE_BAZEL_VERSION: ${{ matrix.bazel_version }}
3192
steps:
3293
- uses: actions/checkout@v2
33-
- uses: ./.github/actions/build_and_test
34-
with:
35-
github_token: ${{ secrets.GITHUB_TOKEN }}
94+
- name: Test
95+
shell: bash
96+
working-directory: examples/bzlmod_specify_assets
97+
run: bazelisk test //...
98+
99+
result:
100+
if: always()
101+
needs:
102+
- build
103+
- example_simple
104+
- example_specify_assets
105+
- example_bzlmod
106+
- example_bzlmod_specify_assets
107+
runs-on: ubuntu-latest
108+
steps:
109+
- run: exit 1
110+
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')

examples/bzlmod/.bazelrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
# Enable bzlmod
1+
try-import %workspace%/../../.bazelrc
2+
23
common --enable_bzlmod
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# Enable bzlmod
1+
try-import %workspace%/../../.bazelrc
2+
23
common --enable_bzlmod
3-
build --test_output=errors

examples/simple/.bazelrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
try-import %workspace%/../../.bazelrc
2+
13
common --enable_bzlmod=false --enable_workspace

examples/specify_assets/.bazelrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
try-import %workspace%/../../.bazelrc
2+
13
common --enable_bzlmod=false --enable_workspace

0 commit comments

Comments
 (0)