freecad@1.1.1_py313_qt6: experiment with running non gui test suite #976
Workflow file for this run
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
| # SPDX-License-Identifier: LGPL-2.1-or-later | |
| # SPDX-FileNotice: Part of the FreeCAD project. | |
| --- | |
| name: brew test-bot | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| pull_request: | |
| workflow_dispatch: # NOTE: nova with homebrew gha | |
| env: | |
| HOMEBREW_NO_ANALYTICS: 1 | |
| HOMEBREW_NO_AUTO_UPDATE: 1 | |
| HOMEBREW_NO_INSTALL_CLEANUP: 1 | |
| HOMEBREW_NO_INSTALL_FROM_API: 1 | |
| HOMEBREW_DEVELOPER: 1 | |
| HOMEBREW_NO_SANDBOX_LINUX: 1 | |
| jobs: | |
| test-bot: | |
| strategy: | |
| # NOTE: ipatch, `fail-fast` disabled because subsequent runners can not run job if previous job failed | |
| fail-fast: false | |
| matrix: | |
| # os: [ubuntu-latest, macos-latest] # NOTE: default | |
| # NOTE: homebrew/homebrew-core uses private self hosted runners | |
| # https://github.com/actions/runner-images | |
| os: | |
| # NOTE: macos-*-large runner requires additional spending limits | |
| # - macos-14-large | |
| - macos-26 | |
| - macos-15 | |
| - macos-15-intel | |
| - macos-14 | |
| # NOTE: deprecated circa nov 4 2025 | |
| # - macos-13 | |
| # NOTE: homebrew has since deprecated ubuntu-22.04 ie. no compat | |
| - ubuntu-24.04 | |
| - ubuntu-24.04-arm | |
| # - self-hosted-catalinavm | |
| # - self-hosted-bigsurvm | |
| # - self-hosted-mojavevm | |
| # - self-hosted-ubuntu-22.04 | |
| # NOTE: ipatch, all three self hosted runners (vms) are hosted on same computer | |
| # ...so limit job to one runner at a time. | |
| # REF: | |
| # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs#defining-the-maximum-number | |
| # max-parallel: 1 | |
| max-parallel: 5 | |
| runs-on: ${{ matrix.os }} | |
| permissions: read-all | |
| # permissions: | |
| # actions: write | |
| # contents: write | |
| # packages: write | |
| # pull-requests: write | |
| timeout-minutes: 1200 | |
| steps: | |
| - name: Test GitHub Token, ie. HOMEBREW_GITHUB_API_TOKEN | |
| continue-on-error: true | |
| run: | | |
| RESPONSE=$(curl -s -L \ | |
| -H "Authorization: Bearer ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}" \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "X-GitHub-Api-Version: 2022-11-28" \ | |
| https://api.github.com/repos/freecad/homebrew-freecad/actions/runners) | |
| # echo "API response: $RESPONSE" | |
| if echo "$RESPONSE" | grep -q '"message": "Bad credentials"'; then | |
| echo "Error: Bad credentials - the GitHub token may be invalid or lacks permissions." | |
| exit 1 | |
| fi | |
| echo "Success: GitHub token is valid." | |
| - name: Get current date | |
| id: get-current-date | |
| run: echo "date=$(date +'%Y-%m-%dT%H:%M:%S')" >> "$GITHUB_ENV" | |
| - name: Set date output | |
| id: set-date | |
| run: echo "date=$(date +'%Y-%m-%dT%H:%M:%S')" >> "$GITHUB_OUTPUT" | |
| - name: Print value of date from previous step | |
| id: print-date | |
| run: echo "${{ steps.set-date.outputs.date }}" | |
| - name: Set default run status | |
| id: set-default-run-status | |
| run: echo "last-run-status=default" >> "$GITHUB_ENV" | |
| - name: Restore last run status | |
| id: restore-last-run-status | |
| uses: actions/cache@v5.0.3 | |
| with: | |
| path: | | |
| last-run-status | |
| key: | | |
| ${{ github.run_id }}-${{ matrix.os }}-${{ steps.set-date.outputs.date }} | |
| restore-keys: | | |
| ${{ github.run_id }}-${{ matrix.os }}- | |
| - name: Set last run status | |
| id: set-last-run-status | |
| run: echo "last-run-status=${{ env.last-run-status }}" >> "GITHUB_OUTPUT" | |
| - name: Set up Homebrew | |
| id: set-up-homebrew | |
| uses: Homebrew/actions/setup-homebrew@main | |
| - name: Get portable Ruby version | |
| id: ruby-version | |
| run: | | |
| ruby_dir=$(basename "$(readlink -f "$(brew --prefix)/Homebrew/Library/Homebrew/vendor/portable-ruby/current")") | |
| echo "version=$ruby_dir" >> "$GITHUB_OUTPUT" | |
| - name: Cache Homebrew Bundler RubyGems | |
| if: steps.set-last-run-status.outputs.last-run-status != 'success' | |
| id: cache | |
| uses: actions/cache@v5.0.3 | |
| with: | |
| path: ${{ steps.set-up-homebrew.outputs.gems-path }} | |
| key: ${{ runner.os }}-ruby-${{ steps.ruby-version.outputs.version }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }} | |
| restore-keys: ${{ runner.os }}-ruby-${{ steps.ruby-version.outputs.version }}-rubygems- | |
| - name: Install Homebrew Bundler RubyGems | |
| if: runner.os == 'Linux' | |
| run: brew install-bundler-gems | |
| - name: sanatize homebrew-core tap | |
| run: | | |
| brew update-reset "$(brew --repository homebrew/core)" || true | |
| git -C "$(brew --repository homebrew/core)" clean -fd || true | |
| - name: Fetch GitHub runners and check if self-hosted | |
| continue-on-error: true | |
| id: fetch-runners-then-check-for-self-hosted | |
| run: | | |
| RESPONSE=$(curl -s -L \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "Authorization: Bearer ${{ secrets.HOMEBREW_GITHUB_API_TOKEN }}" \ | |
| -H "X-GitHub-Api-Version: 2022-11-28" \ | |
| https://api.github.com/repos/freecad/homebrew-freecad/actions/runners) | |
| # debug output of response | |
| echo "API response: $RESPONSE" | |
| # Check if any runner is self-hosted | |
| RUNNER_NAME=$(echo "$RESPONSE" | jq -r '.runners[] | select(.labels[]?.name == "self-hosted") | .name') | |
| if [ -n "$RUNNER_NAME" ]; then | |
| echo "GITHUB_ACTIONS_HOMEBREW_SELF_HOSTED=1" >> "$GITHUB_ENV" | |
| echo "Self-hosted runner found: $RUNNER_NAME" | |
| else | |
| echo "No self-hosted runner found" | |
| fi | |
| - name: manually update GITHUB_ENV based on RUNNER_NAME | |
| id: update-github_env-based-on-runner_name | |
| run: | | |
| if [ "$RUNNER_NAME" = "self-hosted-ubuntu-22.04" ]; then | |
| echo "GITHUB_ACTIONS_HOMEBREW_SELF_HOSTED=1" >> "$GITHUB_ENV" | |
| echo "HOMEBREW_GITHUB_ACTIONS=1" >> "$GITHUB_ENV" | |
| export GITHUB_ACTIONS_HOMEBREW_SELF_HOSTED=1 | |
| export HOMEBREW_GITHUB_ACTIONS=1 | |
| echo "Self-hosted runner found: $RUNNER_NAME" | |
| else | |
| echo "No self-hosted runner found" | |
| fi | |
| - name: free up disk space on github hosted ubuntu runner | |
| if: matrix.os == 'ubuntu-22.04' | |
| # if: ${{ !contains(matrix.os, 'self-hosted-ubuntu-22.04') }} | |
| run: | | |
| echo "Disk space before cleanup:" | |
| df -h | |
| # Remove unnecessary packages and tools | |
| sudo rm -rf /usr/share/dotnet | |
| sudo rm -rf /usr/local/lib/android | |
| sudo rm -rf /opt/ghc | |
| sudo rm -rf /opt/hostedtoolcache/CodeQL | |
| sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
| # Remove large packages | |
| # sudo apt-get remove -y '^aspnetcore-.*' || true | |
| # sudo apt-get remove -y '^dotnet-.*' --fix-missing || true | |
| sudo apt-get remove -y '^llvm-.*' --fix-missing || true | |
| # sudo apt-get remove -y 'php.*' --fix-missing || true | |
| sudo apt-get remove -y '^mongodb-.*' --fix-missing || true | |
| sudo apt-get remove -y '^mysql-.*' --fix-missing || true | |
| sudo apt-get remove -y azure-cli google-chrome-stable firefox powershell mono-devel libgl1-mesa-dri --fix-missing || true | |
| sudo apt-get autoremove -y | |
| sudo apt-get clean | |
| # Remove Docker images | |
| docker image ls -aq | xargs -r docker rmi 2>/dev/null || true | |
| echo "Disk space after cleanup:" | |
| df -h | |
| - name: print message about adding homebrew paths to GITHUB_ENV | |
| if: runner.os == 'Linux' && env.ACT == 'true' | |
| run: | | |
| echo "Adding Homebrew paths to GITHUB_ENV" | |
| - name: add paths to GIHTUB_ENV | |
| if: runner.os == 'Linux' && env.ACT == 'true' | |
| run: | | |
| echo "PATH=/home/linuxbrew/.linuxbrew/sbin:/home/linuxbrew/.linuxbrew/bin:${PATH}" >> "$GITHUB_ENV" | |
| - name: disable homebrew analytics and store value in GITHUB_ENV | |
| if: runner.os == 'Linux' && env.ACT == 'true' | |
| run: | | |
| echo "HOMEBREW_NO_ANALYTICS=1" >> "$GITHUB_ENV" | |
| - name: print env | |
| id: print-env | |
| run: env | |
| - name: run brew config | |
| run: brew config | |
| - name: check env | |
| id: print-the-value-of-GITHUB_ACTIONS_HOMEBREW_SELF_HOSTED-env-var | |
| run: | | |
| echo "the value of GITHUB_ACTIONS_HOMEBREW_SELF_HOSTED is $GITHUB_ACTIONS_HOMEBREW_SELF_HOSTED" | |
| - name: condition, check runner name | |
| # NOTE: use a condition to add env var for mojave runner | |
| # REF: https://docs.github.com/en/actions/learn-github-actions/environment-variables | |
| if: runner.name == 'vmmojave' | |
| run: echo "The operating system on the runner is, $RUNNER_OS."; echo HOMEBREW_DEVELOPER=1 >> "$GITHUB_ENV" | |
| # NOTE: not possible to have two `run:` blocks within a `name` | |
| - name: Install Homebrew Bundler RubyGems | |
| if: steps.cache.outputs.cache-hit != 'true' && steps.set-last-run-status.outputs.last-run-status != 'success' | |
| run: brew install-bundler-gems | |
| - name: only run brew test-bot cleanup before on github hosted runners | |
| if: ${{ !contains(matrix.os, 'self-hosted-ubuntu-22.04') }} | |
| id: brew-test-bot-cleanup-before | |
| run: | | |
| brew test-bot --only-cleanup-before | |
| - run: brew test-bot --only-setup | |
| - run: brew test-bot --only-tap-syntax | |
| - name: check for catalina vm and set homebrew-core repo to specific commit | |
| # NOTE: ipatch, attempt to set homebrew-core repo to specific commit for catalina bottling | |
| if: runner.name == 'vmcatalina' | |
| run: | | |
| cd "$(brew --repo homebrew/core)"; \ | |
| git checkout ipatch-1015-cmake-bottle | |
| - name: condition, update style exceptions for vmmojave | |
| if: runner.name == 'vmmojave' | |
| run: | | |
| sed -i '' \ | |
| -e '/go@1.9/d' \ | |
| -e '/go@1.10/d' \ | |
| -e '/go@1.11/d' \ | |
| -e '/go@1.12/d' \ | |
| "$(brew --repo homebrew/core)/style_exceptions/binary_bootstrap_formula_urls_allowlist.json" | |
| # - name: print event name ----------------------------------------DEBUG | |
| # run: | | |
| # echo "Event Name: ${{ github.event_name }}" | |
| # echo "Event Content: ${{ toJson(github.event) }}" | |
| - name: remove stale cellar lock files | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| find "$(brew --cellar)" -name ".lock" -delete 2>/dev/null || true | |
| - name: pre-install python versions to avoid cellar lock conflicts | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| brew install --formula python@3.14 python@3.13 python@3.12 || true | |
| - name: build bottle using test-bot for current formula | |
| id: build-bottle | |
| env: | |
| # NOTE: ipatch, env var required, see, https://github.com/orgs/Homebrew/discussions/4856 | |
| # TODO: only set this for github hosted linux runners | |
| HOMEBREW_NO_INSTALL_FROM_API: ${{ runner.os != 'Linux' && '1' || '' }} | |
| # Check if the runner name is vmmojave or vmcatalina and add the flag if true | |
| # NOTE: ipatch, keep-old is not the droid you're looking for, | |
| # see: https://github.com/orgs/Homebrew/discussions/4935 | |
| # --keep-old \ | |
| run: | | |
| if [[ runner.name == 'vmmojave' || runner.name == 'vmcatalina' ]]; then | |
| brew test-bot \ | |
| --skip-online-checks \ | |
| --only-formulae \ | |
| --only-json-tab \ | |
| --skip-recursive-dependents \ | |
| --build-dependents-from-source \ | |
| --root-url=https://ghcr.io/v2/freecad/homebrew-freecad | |
| else | |
| brew test-bot \ | |
| --skip-online-checks \ | |
| --only-formulae \ | |
| --only-json-tab \ | |
| --skip-dependents \ | |
| --root-url=https://ghcr.io/v2/freecad/homebrew-freecad | |
| fi | |
| if: github.event_name == 'pull_request' | |
| # - name: debug with tmate on failure | |
| # if: ${{ failure() }} | |
| # uses: mxschmitt/action-tmate@v3 | |
| - name: debug with lhotari/action-upterm | |
| id: debug-workflow-run | |
| if: ${{ failure() && !env.ACT }} # skip during local actions testing using `act` | |
| # NOTE: ipatch, issue with macos runners circa oct 2024 | |
| # uses: lhotari/action-upterm@v1 | |
| #------- | |
| uses: owenthereal/action-upterm@v1 | |
| with: | |
| # limit ssh access to user who triggered the workflow | |
| limit-access-to-actor: true | |
| # shut down server after 10 minutes if no one connects | |
| wait-timeout-minutes: 10 | |
| - name: Upload bottles as artifact | |
| # NOTE: ipatch, issue using upload-artifact@v4 | |
| # see: https://github.com/actions/upload-artifact/issues/478 | |
| id: upload-bottle-artifacts | |
| if: always() && github.event_name == 'pull_request' | |
| # uses: actions/upload-artifact@v4.3.3 | |
| # uses: actions/upload-artifact@v3.1.3 | |
| uses: actions/upload-artifact@v7.0.0 | |
| with: | |
| name: bottles_${{ matrix.os }} | |
| path: '*.bottle.*' | |
| - name: Save run status | |
| id: save-run-status | |
| if: steps.set-last-run-status.outputs.last-run-status != 'success' | |
| run: echo "last-run-status=${{ steps.build-bottle.outcome }}" >> "$GITHUB_ENV" | |