Skip to content

Commit

Permalink
Add test to check codeql-bundle-all
Browse files Browse the repository at this point in the history
  • Loading branch information
angelapwen committed Aug 3, 2023
1 parent a98b9bd commit 3636aac
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/actions/prepare-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ inputs:
version:
description: "The version of the CodeQL CLI to use. Can be 'latest', 'default', 'nightly-latest', 'nightly-YYYY-MM-DD', or 'stable-YYYY-MM-DD'."
required: true
require-codeql-bundle-all:
description: "If true, we output a tools URL with codeql-bundle-all.tar.gz file rather than platform-specific URL"
default: 'false'
required: false
outputs:
tools-url:
description: "The value that should be passed as the 'tools' input of the 'init' step."
Expand All @@ -24,7 +28,9 @@ runs:
run: |
set -e # Fail this Action if `gh release list` fails.
if [[ "$RUNNER_OS" == "Linux" ]]; then
if [[ ${{ inputs.require-codeql-bundle-all }} == "true" ]]; then
artifact_name="codeql-bundle.tar.gz"
elif [[ "$RUNNER_OS" == "Linux" ]]; then
artifact_name="codeql-bundle-linux64.tar.gz"
elif [[ "$RUNNER_OS" == "macOS" ]]; then
artifact_name="codeql-bundle-osx64.tar.gz"
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/test-codeql-bundle-all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: 'PR Check - CodeQL Bundle All'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GO111MODULE: auto
# Disable Kotlin analysis while it's incompatible with Kotlin 1.8, until we find a
# workaround for our PR checks.
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:
test-codeql-bundle-all:
strategy:
matrix:
include:
- os: ubuntu-latest
version: nightly-latest
name: 'CodeQL Bundle All'
permissions:
contents: read
security-events: write
timeout-minutes: 45
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Prepare test
id: prepare-test
uses: ./.github/actions/prepare-test
with:
version: ${{ matrix.version }}
require-codeql-bundle-all: true
- id: init
uses: ./../action/init
with:
tools: ${{ steps.prepare-test.outputs.tools-url }}
- uses: ./../action/.github/actions/setup-swift
with:
codeql-path: ${{ steps.init.outputs.codeql-path }}
- name: Build code
shell: bash
run: ./build.sh
- uses: ./../action/analyze
with:
upload-database: false
env:
CODEQL_ACTION_TEST_MODE: true

0 comments on commit 3636aac

Please sign in to comment.