diff --git a/.github/workflows/__init-with-registries.yml b/.github/workflows/__init-with-registries.yml index 118440242c..37bceb6f53 100644 --- a/.github/workflows/__init-with-registries.yml +++ b/.github/workflows/__init-with-registries.yml @@ -25,6 +25,18 @@ jobs: strategy: matrix: include: + - os: ubuntu-latest + version: cached + - os: macos-latest + version: cached + - os: windows-latest + version: cached + - os: ubuntu-latest + version: latest + - os: macos-latest + version: latest + - os: windows-latest + version: latest - os: ubuntu-latest version: nightly-latest - os: macos-latest @@ -75,5 +87,37 @@ jobs: echo "::error $CODEQL_PACK1 pack was not installed." exit 1 fi + + - name: Verify qlconfig.yml file was created + shell: bash + run: | + QLCONFIG_PATH=$RUNNER_TEMP/qlconfig.yml + echo "Expected qlconfig.yml file to be created at $QLCONFIG_PATH" + if [[ -f $QLCONFIG_PATH ]] + then + echo "qlconfig.yml file was created." + else + echo "::error qlconfig.yml file was not created." + exit 1 + fi + + - name: Verify contents of qlconfig.yml + # yq is not available on windows + if: runner.os != 'Windows' + shell: bash + run: | + QLCONFIG_PATH=$RUNNER_TEMP/qlconfig.yml + cat $QLCONFIG_PATH | yq -e '.registries[] | select(.url == "https://ghcr.io/v2/") | select(.packages == "*/*")' + if [[ $? -eq 0 ]] + then + echo "Registry was added to qlconfig.yml file." + else + echo "::error Registry was not added to qlconfig.yml file." + echo "Contents of qlconfig.yml file:" + cat $QLCONFIG_PATH + exit 1 + fi env: + CODEQL_PASS_CONFIG_TO_CLI: 'true' + CODEQL_ACTION_TEST_MODE: true diff --git a/pr-checks/checks/init-with-registries.yml b/pr-checks/checks/init-with-registries.yml index 6ab1a53dfe..7abf122052 100644 --- a/pr-checks/checks/init-with-registries.yml +++ b/pr-checks/checks/init-with-registries.yml @@ -4,7 +4,15 @@ # basic mechanics of multi-registry auth is working. name: "Packaging: Download using registries" description: "Checks that specifying a registries block and associated auth works as expected" -versions: ["nightly-latest"] # This feature is not compatible with old CLIs +versions: [ + # This feature is not compatible with older CLIs + "cached", + "latest", + "nightly-latest", +] + +env: + CODEQL_PASS_CONFIG_TO_CLI: 'true' steps: - name: Init with registries @@ -40,3 +48,33 @@ steps: echo "::error $CODEQL_PACK1 pack was not installed." exit 1 fi + + - name: Verify qlconfig.yml file was created + shell: bash + run: | + QLCONFIG_PATH=$RUNNER_TEMP/qlconfig.yml + echo "Expected qlconfig.yml file to be created at $QLCONFIG_PATH" + if [[ -f $QLCONFIG_PATH ]] + then + echo "qlconfig.yml file was created." + else + echo "::error qlconfig.yml file was not created." + exit 1 + fi + + - name: Verify contents of qlconfig.yml + # yq is not available on windows + if: runner.os != 'Windows' + shell: bash + run: | + QLCONFIG_PATH=$RUNNER_TEMP/qlconfig.yml + cat $QLCONFIG_PATH | yq -e '.registries[] | select(.url == "https://ghcr.io/v2/") | select(.packages == "*/*")' + if [[ $? -eq 0 ]] + then + echo "Registry was added to qlconfig.yml file." + else + echo "::error Registry was not added to qlconfig.yml file." + echo "Contents of qlconfig.yml file:" + cat $QLCONFIG_PATH + exit 1 + fi