mirror of
https://github.com/google/or-tools.git
synced 2026-03-26 21:08:29 +00:00
Bumps the github-actions group with 2 updates: [actions/cache](https://github.com/actions/cache) and [bazel-contrib/setup-bazel](https://github.com/bazel-contrib/setup-bazel). Updates `actions/cache` from 4 to 5 - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v4...v5) Updates `bazel-contrib/setup-bazel` from 0.15.0 to 0.18.0 - [Release notes](https://github.com/bazel-contrib/setup-bazel/releases) - [Commits](https://github.com/bazel-contrib/setup-bazel/compare/0.15.0...0.18.0) --- updated-dependencies: - dependency-name: actions/cache dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: bazel-contrib/setup-bazel dependency-version: 0.18.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions ... Signed-off-by: dependabot[bot] <support@github.com>
88 lines
2.8 KiB
YAML
88 lines
2.8 KiB
YAML
# ref: https://github.com/actions/runner-images
|
|
name: amd64 Linux Bazel
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- v99bugfix
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{github.workflow}}-${{github.ref}}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
cache-root: /tmp/bazel
|
|
|
|
# Building using the github runner environement directly.
|
|
jobs:
|
|
amd64-Linux-Bazel-Python:
|
|
strategy:
|
|
matrix:
|
|
python: [
|
|
#{version: '3.10'},
|
|
#{version: '3.11'},
|
|
{version: '3.12'},
|
|
#{version: '3.13'},
|
|
#{version: '3.14'},
|
|
]
|
|
fail-fast: false
|
|
env:
|
|
CC: gcc-12
|
|
CXX: g++-12
|
|
cache-name: ${{github.job}}-${{matrix.python.version}}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- name: Check Java
|
|
run: java -version
|
|
- name: Check mvn
|
|
run: mvn --version
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: ${{matrix.python.version}}
|
|
- name: Check Python
|
|
run: python --version
|
|
- name: Install Bazel
|
|
run: |
|
|
curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg
|
|
sudo mv bazel.gpg /etc/apt/trusted.gpg.d/
|
|
echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
|
|
sudo apt-get update
|
|
sudo apt-get install bazel
|
|
- name: Check Bazel
|
|
run: bazel version
|
|
- name: Change Python in .bazelrc
|
|
run: |
|
|
sed -i -e 's/\(python_version=\)3.[0-9]\+/\1${{matrix.python.version}}/g' .bazelrc
|
|
cat .bazelrc
|
|
- name: Change Python in .bazelrc
|
|
run: |
|
|
sed -i -e 's/\(DEFAULT_PYTHON =\) "3.[0-9]\+"/\1 "${{matrix.python.version}}"/g' MODULE.bazel
|
|
cat MODULE.bazel
|
|
- name: Restore bazel cache
|
|
uses: actions/cache/restore@v5
|
|
id: bazel-cache-restore
|
|
with:
|
|
key: ${{env.cache-name}}
|
|
path: ${{env.cache-root}}
|
|
- name: Build
|
|
run: bazel --output_user_root=${{env.cache-root}} build --config=ci //ortools/... //examples/...
|
|
- name: Test
|
|
run: bazel --output_user_root=${{env.cache-root}} test --config=ci //ortools/... //examples/...
|
|
- name: Save Bazel cache for branch main even when Build and Test fail.
|
|
uses: actions/cache/save@v5
|
|
# https://docs.github.com/en/actions/reference/workflows-and-actions/dependency-caching#restrictions-for-accessing-a-cache
|
|
if: always() && github.ref == 'refs/heads/main'
|
|
with:
|
|
key: ${{env.cache-name}}-${{github.sha}}
|
|
path: ${{env.cache-root}}
|
|
|
|
amd64_linux_bazel:
|
|
runs-on: ubuntu-latest
|
|
needs: amd64-Linux-Bazel-Python
|
|
steps:
|
|
- uses: actions/checkout@v6
|