@@ -20,18 +20,18 @@ jobs:
20
20
fail-fast : false # Don't cancel all jobs if one fails.
21
21
matrix :
22
22
include :
23
- # Temporarily disabled until Copybara fixes its cap of 30 jobs per PR.
24
- # - { NAME: "Fastbuild", BAZEL: bazel, CC: clang, os: ubuntu-20-large, flags: "" }
25
- # - { NAME: "Optmized", BAZEL: bazel, CC: clang, os: ubuntu-20-large, flags: "-c opt" } # Some warnings only fire with -c opt
23
+ - { NAME: "Fastbuild", BAZEL: bazel, CC: clang, os: ubuntu-20-large, flags: "" }
24
+ - { NAME: "Optmized", BAZEL: bazel, CC: clang, os: ubuntu-20-large, flags: "-c opt" } # Some warnings only fire with -c opt
26
25
- { NAME: "GCC Optimized", BAZEL: bazel, CC: gcc-12, os: ubuntu-22.04, flags: "-c opt" }
27
26
- { NAME: "FastTable", BAZEL: bazel, CC: clang, os: ubuntu-20-large, flags: "--//:fasttable_enabled=true -- -cmake:test_generated_files" }
28
27
- { NAME: "ASAN", BAZEL: bazel, CC: clang, os: ubuntu-20-large, flags: "--config=asan -c dbg -- -benchmarks:benchmark -python/..." }
29
28
- { NAME: "UBSAN", BAZEL: bazel, CC: clang, os: ubuntu-20-large, flags: "--config=ubsan -c dbg -- -benchmarks:benchmark -python/... -lua/...", install: "libunwind-dev" }
30
29
- { NAME: "32-bit", BAZEL: bazel, CC: clang, os: ubuntu-20-large, flags: "--copt=-m32 --linkopt=-m32 -- -... benchmarks:benchmark ", install: "g++-multilib" }
31
- - { NAME: "macOS", BAZEL: bazel, CC: clang, os: macos-11, flags: "" }
30
+ - { NAME: "macOS", BAZEL: bazel, CC: clang, os: macos-11 }
31
+ - { NAME: "windows", BAZEL: bazel, os: windows-2019, startup-flags: "--output_user_root=C:/tmp", flags: "--config=cpp17_msvc", targets: "upb/... upbc/... python/... protos/... protos_generator/..." }
32
32
# We support two Bazel versions back per https://opensource.google/documentation/policies/cplusplus-support
33
- - { NAME: "Bazel 4.1.0", BAZEL: bazel-4.1.0-linux-x86_64, CC: clang, os: ubuntu-20-large, flags: "" }
34
- - { NAME: "Bazel 5.3.0", BAZEL: bazel-5.3.0-linux-x86_64, CC: clang, os: ubuntu-20-large, flags: "" }
33
+ - { NAME: "Bazel 4.1.0", BAZEL: bazel-4.1.0-linux-x86_64, CC: clang, os: ubuntu-20-large }
34
+ - { NAME: "Bazel 5.3.0", BAZEL: bazel-5.3.0-linux-x86_64, CC: clang, os: ubuntu-20-large }
35
35
36
36
name : ${{ matrix.NAME }}
37
37
@@ -52,44 +52,48 @@ jobs:
52
52
wget -O $FILENAME https://github.com/bazelbuild/bazel/releases/download/$VERSION/${{ matrix.BAZEL }}
53
53
chmod a+x $FILENAME
54
54
if : ${{ matrix.BAZEL != 'bazel' }}
55
- - name : Check tool versions
56
- run : |
57
- ${{ matrix.CC }} --version
58
- ${{ matrix.BAZEL }} --version
55
+ - name : Check compiler versions
56
+ if : matrix.CC
57
+ run : ${{ matrix.CC }} --version
58
+ - name : Check Bazel versions
59
+ run : ${{ matrix.BAZEL }} --version
59
60
- id : bazel-cache
60
61
name : Set up Bazel caching
61
62
uses : ./.github/actions/setup-bazel-cache
62
63
- name : Setup Python venv
64
+ if : ${{ runner.os != 'Windows' }}
63
65
run : rm -rf /tmp/venv && python3 -m venv /tmp/venv && source /tmp/venv/bin/activate && python3 --version
64
66
- name : Install dependencies
65
67
run : sudo apt update && sudo apt install -y ${{ matrix.install }}
66
68
if : matrix.install != ''
67
69
- name : Install numpy
68
- run : source /tmp/venv/bin/activate && pip3 install numpy
70
+ run : pip3 install numpy
71
+ - name : Setup environment variables
72
+ if : matrix.CC
73
+ run : echo "CC=${{ matrix.CC }}" >> $GITHUB_ENV
69
74
- name : Run tests
70
- run : cd ${{ github.workspace }} && source /tmp/venv/bin/activate && CC= ${{ matrix.CC }} ${{ matrix.BAZEL }} test --test_output=errors ${{ steps.bazel-cache.outputs.cache_args }} ... ${{ matrix.flags }}
75
+ run : cd ${{ github.workspace }} && ${{ matrix.BAZEL }} ${{ matrix.startup-flags }} test --test_output=errors ${{ steps.bazel-cache.outputs.cache_args }} ${{ matrix.targets | "..." }} ${{ matrix.flags }}
71
76
72
- # Temporarily disabled until Copybara fixes its cap of 30 jobs per PR.
73
- # no-python:
74
- # runs-on: ubuntu-20-large
77
+ no-python :
78
+ runs-on : ubuntu-20-large
75
79
76
- # strategy:
77
- # fail-fast: false # Don't cancel all jobs if one fails.
80
+ strategy :
81
+ fail-fast : false # Don't cancel all jobs if one fails.
78
82
79
- # name: "No System Python"
83
+ name : " No System Python"
80
84
81
- # steps:
82
- # - uses: actions/checkout@v2
83
- # - name: Set up Cloud SDK
84
- # uses: google-github-actions/auth@v0
85
- # with:
86
- # credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }}
87
- # export_environment_variables: true
88
- # if: ${{ github.event.pull_request.head.repo.full_name == 'protocolbuffers/upb' }}
89
- # - id: bazel-cache
90
- # name: Set up Bazel caching
91
- # uses: ./.github/actions/setup-bazel-cache
92
- # - name: Uninstall python
93
- # run: which python3 && sudo mv `which python3` /tmp && ! which python3
94
- # - name: Run tests
95
- # run: cd ${{ github.workspace }} && bazel test --test_output=errors ${{ steps.bazel-cache.outputs.cache_args }} //python/... -- -//python/dist:source_wheel
85
+ steps :
86
+ - uses : actions/checkout@v2
87
+ - name : Set up Cloud SDK
88
+ uses : google-github-actions/auth@v0
89
+ with :
90
+ credentials_json : ${{ secrets.GOOGLE_CREDENTIALS }}
91
+ export_environment_variables : true
92
+ if : ${{ github.event.pull_request.head.repo.full_name == 'protocolbuffers/upb' }}
93
+ - id : bazel-cache
94
+ name : Set up Bazel caching
95
+ uses : ./.github/actions/setup-bazel-cache
96
+ - name : Uninstall python
97
+ run : which python3 && sudo mv `which python3` /tmp && ! which python3
98
+ - name : Run tests
99
+ run : cd ${{ github.workspace }} && bazel test --test_output=errors ${{ steps.bazel-cache.outputs.cache_args }} //python/... -- -//python/dist:source_wheel
0 commit comments