Update --language
support for new-query
subcommand
#5
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
name: ⚙️ Internal - Validate CLI Outputs | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
branches: | |
- 'main' | |
workflow_dispatch: | |
env: | |
# Global configuration | |
DOTNET_VERSION: '6.0.x' | |
BUILD_CONFIGURATION: Debug | |
jobs: | |
validate-cli-outputs: | |
name: Validate CodeQlToolkit `query generate new-query` subcommand | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ env.DOTNET_VERSION }} | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build project | |
run: dotnet build -c ${{ env.BUILD_CONFIGURATION }} --no-restore | |
- name: Set test directory | |
run: echo "TEST_DIR=${{ runner.temp }}/qlt-cli-e2e-test" >> $GITHUB_ENV | |
- name: Prepare test environment | |
run: | | |
# Create test directory | |
mkdir -p "$TEST_DIR" | |
# Copy configuration file | |
cp example/qlt.conf.json "$TEST_DIR" | |
## Using the 'latest' version of the `codeql` CLI may eventually | |
## cause issues, where the `qlt.conf.json` file specifies an exact | |
## version of the CLI. For now, we live with the risk, and the issues | |
## surfaced might actually be useful to identify emerging problems | |
## in the `codeql` CLI -- which is only required here for extra | |
## debugging of any queries with test failures. | |
- name: Install `codeql` CLI | |
id: install-codeql | |
uses: ./.github/actions/install-codeql | |
with: | |
add-to-path: 'true' | |
codeql-cli-version: 'latest' | |
codeql-stdlib-version: 'latest' | |
- name: Run end-to-end CLI validation | |
run: ./scripts/validate-cli-e2e.sh | |
- name: Upload test artifacts on failure | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cli-validation-artifacts | |
path: ${{ runner.temp }}/qlt-cli-e2e-test/** | |
if-no-files-found: warn | |
retention-days: 3 |