feat: add target toolchain options to clang toolchain #629
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
env: | |
GOPROXY: https://proxy.golang.org | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: "true" | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- uses: actions/setup-go@v5 | |
- uses: bazel-contrib/[email protected] | |
with: | |
# Avoid downloading Bazel every time. | |
bazelisk-cache: true | |
# Store build cache per workflow. | |
disk-cache: ${{ github.workflow }} | |
# Share repository cache between workflows. | |
repository-cache: true | |
- run: echo "PATH=$PATH:/home/runner/go/bin" >> $GITHUB_ENV | |
- uses: pre-commit/[email protected] | |
commit-check: | |
name: Commit checks | |
strategy: | |
matrix: | |
go: ["1.18"] | |
os: [ubuntu-latest] | |
python: ["3.x"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Setup Go ${{ matrix.go }} | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{matrix.go}} | |
id: go | |
- name: Setup Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: "true" | |
- name: Install python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r .github/pip_requirements.txt | |
go-tests: | |
name: Go ${{ matrix.go }} tests ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
go: ["1.18", "1.19", "1.20"] | |
os: [ubuntu-latest] | |
include: | |
- go: "1.18" | |
os: macos-13 | |
- go: "1.20" | |
os: macos-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
submodules: "true" | |
- name: Setup Go ${{ matrix.go }} | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{matrix.go}} | |
id: go | |
- name: Install dependencies | |
run: go mod download | |
- name: Build | |
run: go build -v ./... | |
- name: Test | |
run: go test -v ./... | |
- name: Run go vet | |
run: go vet ./... | |
python-tests: | |
name: Python ${{ matrix.python }} tests ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python: ["3.8", "3.9", "3.10"] | |
os: [ubuntu-latest] | |
include: | |
- python: "3.8" | |
os: macos-13 | |
- python: "3.10" | |
os: macos-latest | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Setup Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r .github/pip_requirements.txt | |
- name: config_system regression tests | |
run: config_system/tests/run_tests.py | |
- name: Mconfigfmt tests | |
run: config_system/tests/run_tests_formatter.py | |
- name: config_system pytest | |
run: pytest config_system | |
- name: scripts pytest | |
run: pytest scripts/env_hash.py | |
build-tests: | |
name: Test ${{ matrix.os }}, Go ${{ matrix.go }}, Python ${{ matrix.python }} | |
strategy: | |
fail-fast: false | |
matrix: | |
go: ["1.18", "1.19", "1.20"] | |
os: [ubuntu-latest] | |
python: ["3.x"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Setup Go ${{ matrix.go }} | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{matrix.go}} | |
id: go | |
- name: Setup Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install tools | |
run: | | |
if [ "$RUNNER_OS" == "Linux" ] ; then | |
sudo apt-get install ninja-build rsync | |
elif [ "$RUNNER_OS" == "macOS" ] ; then | |
brew install ninja rsync | |
else | |
echo "$RUNNER_OS not supported" | |
exit 1 | |
fi | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: "true" | |
- name: Install python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r .github/pip_requirements.txt | |
- name: Relative path tests | |
run: tests/relative_path_tests.sh | |
- name: Build tests | |
run: tests/build_tests.sh | |
- name: Test example project | |
run: .github/build_example_proj.sh | |
- name: Bootstrap version test | |
run: .github/run_bootstrap_test.sh | |
bazel: | |
name: "Bazel ${{matrix.bazel}} ${{ matrix.os }}" | |
env: | |
USE_BAZEL_VERSION: ${{ matrix.bazel }} | |
strategy: | |
fail-fast: false | |
matrix: | |
bazel: ["8.0.0"] | |
os: [ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: "true" | |
- uses: bazel-contrib/[email protected] | |
with: | |
# Avoid downloading Bazel every time. | |
bazelisk-cache: true | |
# Store build cache per workflow. | |
disk-cache: ${{ github.workflow }} | |
# Share repository cache between workflows. | |
repository-cache: true | |
- name: Mount bazel cache # Optional | |
uses: actions/cache@v4 | |
with: | |
path: "~/.cache/bazel" | |
key: bazel-${{matrix.bazel}}-${{matrix.os}} | |
- name: Bazel version | |
run: bazelisk version | |
- name: Bazel test `bob` | |
run: bazelisk test --config=ci //... | |
- name: Bazel test `bob-gazelle` | |
run: bazelisk test --config=ci //... | |
working-directory: ./gazelle | |
- name: Bazel test `bob-gazelle integration tests` | |
run: | | |
bazelisk run @gazelle//:gazelle --config=ci | |
LOG=`git diff` | |
if [[ -n "${LOG}" ]]; then | |
printf >&2 "%s\n" "${LOG}" | |
exit 1 | |
fi | |
bazelisk build //... | |
working-directory: ./gazelle/tests/integration_tests | |
bazel-coverage: | |
name: "Bazel Coverage" | |
env: | |
USE_BAZEL_VERSION: "8.0.0" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: "true" | |
- uses: bazel-contrib/[email protected] | |
with: | |
# Avoid downloading Bazel every time. | |
bazelisk-cache: true | |
# Store build cache per workflow. | |
disk-cache: ${{ github.workflow }} | |
# Share repository cache between workflows. | |
repository-cache: true | |
- name: Mount bazel cache | |
uses: actions/cache@v4 | |
with: | |
path: "~/.cache/bazel" | |
key: bazel-coverage | |
- name: Setup LCOV | |
uses: hrishikesh-kadam/setup-lcov@v1 | |
with: | |
ref: v1.14 | |
- name: Generate Coverage | |
run: | | |
bazelisk clean --expunge | |
bazelisk coverage --config=ci --instrument_test_targets --@io_bazel_rules_go//go/config:cover_format=lcov --combined_report=lcov --cache_test_results=no //... | |
cp "$(bazelisk info output_path)/_coverage/_coverage_report.dat" coverage_report.dat | |
- name: Report code coverage | |
uses: zgosalvez/github-actions-report-lcov@v4 | |
with: | |
coverage-files: coverage_report.dat | |
artifact-name: code-coverage-report | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
update-comment: true |