From 959337a156313be9107108888c58454ef37fdf9e Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Tue, 24 Oct 2023 11:10:13 +0200 Subject: [PATCH] C++: fix autobuild pr-checks for macOS --- .github/workflows/__cpp-deptrace-disabled.yml | 2 - .../__cpp-deptrace-enabled-on-macos.yml | 76 +++++++++++++++++++ .github/workflows/__cpp-deptrace-enabled.yml | 2 - pr-checks/checks/cpp-deptrace-disabled.yml | 2 +- .../checks/cpp-deptrace-enabled-on-macos.yml | 28 +++++++ pr-checks/checks/cpp-deptrace-enabled.yml | 2 +- 6 files changed, 106 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/__cpp-deptrace-enabled-on-macos.yml create mode 100644 pr-checks/checks/cpp-deptrace-enabled-on-macos.yml diff --git a/.github/workflows/__cpp-deptrace-disabled.yml b/.github/workflows/__cpp-deptrace-disabled.yml index 6bf59b5b4..862010bbc 100644 --- a/.github/workflows/__cpp-deptrace-disabled.yml +++ b/.github/workflows/__cpp-deptrace-disabled.yml @@ -27,8 +27,6 @@ jobs: include: - os: ubuntu-latest version: latest - - os: macos-latest - version: latest name: 'Cpp: disabling autoinstalling dependencies' permissions: contents: read diff --git a/.github/workflows/__cpp-deptrace-enabled-on-macos.yml b/.github/workflows/__cpp-deptrace-enabled-on-macos.yml new file mode 100644 index 000000000..e9d05a43d --- /dev/null +++ b/.github/workflows/__cpp-deptrace-enabled-on-macos.yml @@ -0,0 +1,76 @@ +# Warning: This file is generated automatically, and should not be modified. +# Instead, please modify the template in the pr-checks directory and run: +# (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py) +# to regenerate this file. + +name: 'PR Check - Cpp: disabling autoinstalling dependencies' +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GO111MODULE: auto + CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true' +on: + push: + branches: + - main + - releases/v2 + pull_request: + types: + - opened + - synchronize + - reopened + - ready_for_review + workflow_dispatch: {} +jobs: + cpp-deptrace-enabled-on-macos: + strategy: + matrix: + include: + - os: macos-latest + version: latest + name: 'Cpp: disabling autoinstalling dependencies' + permissions: + contents: read + security-events: write + timeout-minutes: 45 + runs-on: ${{ matrix.os }} + steps: + - name: Check out repository + uses: actions/checkout@v4 + - name: Prepare test + id: prepare-test + uses: ./.github/actions/prepare-test + with: + version: ${{ matrix.version }} + use-all-platform-bundle: 'false' + - name: Set environment variable for Swift enablement + if: >- + runner.os != 'Windows' && ( + matrix.version == '20220908' || + matrix.version == '20221211' + ) + shell: bash + run: echo "CODEQL_ENABLE_EXPERIMENTAL_FEATURES_SWIFT=true" >> $GITHUB_ENV + - name: Test setup + shell: bash + run: | + cp -a ../action/tests/cpp-autobuild autobuild-dir + - uses: ./../action/init + with: + languages: cpp + tools: ${{ steps.prepare-test.outputs.tools-url }} + - uses: ./../action/autobuild + with: + working-directory: autobuild-dir + env: + CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES: true + - shell: bash + run: | + if ! ls /usr/bin/errno; then + echo "As expected, CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES is a no-op on macOS" + else + echo "CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES should not have had any effect on macOS" + exit 1 + fi + env: + DOTNET_GENERATE_ASPNET_CERTIFICATE: 'false' + CODEQL_ACTION_TEST_MODE: true diff --git a/.github/workflows/__cpp-deptrace-enabled.yml b/.github/workflows/__cpp-deptrace-enabled.yml index 2d964f731..9f4affdb9 100644 --- a/.github/workflows/__cpp-deptrace-enabled.yml +++ b/.github/workflows/__cpp-deptrace-enabled.yml @@ -27,8 +27,6 @@ jobs: include: - os: ubuntu-latest version: latest - - os: macos-latest - version: latest name: 'Cpp: enabling autoinstalling dependencies' permissions: contents: read diff --git a/pr-checks/checks/cpp-deptrace-disabled.yml b/pr-checks/checks/cpp-deptrace-disabled.yml index c904ef6a6..30e6baecb 100644 --- a/pr-checks/checks/cpp-deptrace-disabled.yml +++ b/pr-checks/checks/cpp-deptrace-disabled.yml @@ -1,6 +1,6 @@ name: "Cpp: disabling autoinstalling dependencies" description: "Checks that running C/C++ autobuild with autoinstalling dependencies explicitly disabled works" -operatingSystems: ["ubuntu", "macos"] +operatingSystems: ["ubuntu"] versions: ["latest"] env: DOTNET_GENERATE_ASPNET_CERTIFICATE: "false" diff --git a/pr-checks/checks/cpp-deptrace-enabled-on-macos.yml b/pr-checks/checks/cpp-deptrace-enabled-on-macos.yml new file mode 100644 index 000000000..769e095b2 --- /dev/null +++ b/pr-checks/checks/cpp-deptrace-enabled-on-macos.yml @@ -0,0 +1,28 @@ +name: "Cpp: disabling autoinstalling dependencies" +description: "Checks that running C/C++ autobuild with autoinstalling dependencies explicitly disabled works" +operatingSystems: ["macos"] +versions: ["latest"] +env: + DOTNET_GENERATE_ASPNET_CERTIFICATE: "false" +steps: + - name: Test setup + shell: bash + run: | + cp -a ../action/tests/cpp-autobuild autobuild-dir + - uses: ./../action/init + with: + languages: cpp + tools: ${{ steps.prepare-test.outputs.tools-url }} + - uses: ./../action/autobuild + with: + working-directory: autobuild-dir + env: + CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES: true + - shell: bash + run: | + if ! ls /usr/bin/errno; then + echo "As expected, CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES is a no-op on macOS" + else + echo "CODEQL_EXTRACTOR_CPP_AUTOINSTALL_DEPENDENCIES should not have had any effect on macOS" + exit 1 + fi diff --git a/pr-checks/checks/cpp-deptrace-enabled.yml b/pr-checks/checks/cpp-deptrace-enabled.yml index 8da46e66b..0a1999112 100644 --- a/pr-checks/checks/cpp-deptrace-enabled.yml +++ b/pr-checks/checks/cpp-deptrace-enabled.yml @@ -1,6 +1,6 @@ name: "Cpp: enabling autoinstalling dependencies" description: "Checks that running C/C++ autobuild with autoinstalling dependencies works" -operatingSystems: ["ubuntu", "macos"] +operatingSystems: ["ubuntu"] versions: ["latest"] env: DOTNET_GENERATE_ASPNET_CERTIFICATE: "false"