CI(backport): Refine label checker action #2012
This file contains 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: Build | |
on: [push, pull_request] | |
env: | |
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) | |
BUILD_TYPE: Release | |
CMAKE_OPTIONS: | | |
-Dtests=ON -Dsymbols=ON -Ddisplay-install-paths=ON | |
MUMBLE_ENVIRONMENT_SOURCE: 'https://dl.mumble.info/build/vcpkg/' | |
jobs: | |
skip_test: | |
runs-on: ubuntu-latest | |
outputs: | |
should_skip: ${{ steps.skip_check.outputs.should_skip }} | |
steps: | |
- id: skip_check | |
uses: fkirc/skip-duplicate-actions@v5 | |
with: | |
concurrent_skipping: same_content_newer | |
skip_after_successful_duplicate: 'true' | |
fetch_build_number: | |
runs-on: ubuntu-latest | |
outputs: | |
build_number: ${{ steps.fetch.outputs.build_number }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- id: fetch | |
shell: bash | |
run: | | |
echo "build_number=$( '${{ github. workspace }}/scripts/mumble-build-number.py' \ | |
--commit ${{ github.sha }} --version $( '${{ github.workspace }}/scripts/mumble-version.py' ) \ | |
--password '${{ secrets.BUILD_NUMBER_TOKEN }}' --default 0 )" >> $GITHUB_OUTPUT | |
build: | |
needs: [ skip_test, fetch_build_number ] | |
if: needs.skip_test.outputs.should_skip != 'true' | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-22.04, ubuntu-24.04] | |
type: [shared] # Currently the "static" build doesn't work for Linux systems | |
arch: [64bit] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Print diskspace | |
run: df -BM | |
shell: bash | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
fetch-depth: 1 | |
- name: Set environment variables | |
run: $GITHUB_WORKSPACE/.github/workflows/set_environment_variables.sh "${{ matrix.os }}" "${{ matrix.type }}" "${{ matrix.arch }}" "${{ runner.workspace }}" | |
shell: bash | |
- uses: actions/cache@v4 | |
with: | |
path: '${{ env.MUMBLE_BUILD_ENV_PATH }}' | |
key: ${{ env.MUMBLE_ENVIRONMENT_VERSION }} | |
- uses: ./.github/actions/install-dependencies | |
with: | |
type: ${{ matrix.type }} | |
os: ${{ matrix.os }} | |
arch: ${{ matrix.arch }} | |
- name: Build | |
run: ./.github/workflows/build.sh | |
shell: bash | |
env: | |
MUMBLE_BUILD_NUMBER: ${{ needs.fetch_build_number.outputs.build_number }} | |
- name: Test | |
working-directory: ${{ github.workspace }}/build | |
shell: bash | |
run: QT_QPA_PLATFORM=offscreen ctest --output-on-failure -C $BUILD_TYPE | |