test #1
This file contains 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
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions | |
name: CodeQL | |
on: | |
push: | |
branches: [ "main" ] | |
paths-ignore: | |
- '**/*.md' | |
- '.github/*.yml' | |
- '.github/workflows/build.yml' | |
- '.github/workflows/bump-version.yml' | |
- '.github/workflows/licensecheck.yml' | |
- '.github/workflows/validate_pr.yml' | |
- '**/.project' | |
- '**/.settings/*.prefs' | |
- '.gitignore' | |
- '.actrc' | |
- 'Jenkinsfile' | |
pull_request: | |
branches: [ "main" ] | |
paths-ignore: | |
- '**/*.md' | |
- '.github/*.yml' | |
- '.github/workflows/build.yml' | |
- '.github/workflows/bump-version.yml' | |
- '.github/workflows/licensecheck.yml' | |
- '.github/workflows/validate_pr.yml' | |
- '**/.project' | |
- '**/.settings/*.prefs' | |
- '.gitignore' | |
- '.actrc' | |
- 'Jenkinsfile' | |
workflow_dispatch: | |
# https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/ | |
defaults: | |
run: | |
shell: bash | |
env: | |
JAVA_VERSION: 17 | |
jobs: | |
########################################################### | |
analyze: | |
########################################################### | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# build-mode: https://github.com/github/codeql-action#build-modes | |
- language: java-kotlin | |
build-mode: manual | |
- language: javascript-typescript | |
build-mode: none | |
- language: python | |
build-mode: none | |
name: Analyze (${{ matrix.language }}) | |
runs-on: ubuntu-latest | |
permissions: | |
# required for all workflows | |
security-events: write | |
# required to fetch internal or private CodeQL packs | |
packages: read | |
# only required for workflows in private repositories | |
actions: read | |
contents: read | |
timeout-minutes: 15 | |
steps: | |
- name: "Show: GitHub context" | |
env: | |
GITHUB_CONTEXT: ${{ toJSON(github) }} | |
run: echo $GITHUB_CONTEXT | |
- name: "Show: environment variables" | |
run: env | sort | |
- name: Git Checkout | |
uses: actions/checkout@v4 # https://github.com/actions/checkout | |
with: | |
fetch-depth: 0 # required to prevent tycho-p2-extras-plugin:compare-version-with-baseline potentially failing the build | |
- name: "Install: JDK ${{ env.JAVA_VERSION }} ☕" | |
if: ${{ matrix.language == 'java-kotlin' }} | |
uses: actions/setup-java@v4 # https://github.com/actions/setup-java | |
with: | |
distribution: temurin | |
java-version: ${{ env.JAVA_VERSION }} | |
cache: maven | |
- name: "Cache: Local Maven Repository" | |
if: ${{ matrix.language == 'java-kotlin' }} | |
uses: actions/cache/restore@v4 | |
with: | |
# Excluded sub directory not working https://github.com/actions/toolkit/issues/713 | |
path: | | |
~/.m2/repository/* | |
!~/.m2/repository/.cache/tycho | |
!~/.m2/repository/.meta/p2-artifacts.properties | |
!~/.m2/repository/p2 | |
!~/.m2/repository/*SNAPSHOT* | |
key: ${{ runner.os }}-${{ runner.arch }}-repo-mvn-${{ hashFiles('**/pom.xml') }} | |
- name: "Cache: Local Tycho Repository" | |
if: ${{ matrix.language == 'java-kotlin' }} | |
uses: actions/cache/restore@v4 | |
with: | |
path: | | |
~/.m2/repository/.cache/tycho | |
~/.m2/repository/.meta/p2-artifacts.properties | |
~/.m2/repository/p2 | |
key: ${{ runner.os }}-${{ runner.arch }}-repo-tycho-${{ hashFiles('target-platforms/oldest.target') }} | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v3 | |
with: | |
languages: ${{ matrix.language }} | |
build-mode: ${{ matrix.build-mode }} | |
- name: "Build with Maven 🔨" | |
if: ${{ matrix.language == 'java-kotlin' }} | |
continue-on-error: ${{ matrix.target-platform == 'unstable' }} | |
run: | | |
set -euo pipefail | |
./mvnw \ | |
--errors \ | |
--update-snapshots \ | |
--batch-mode \ | |
--show-version \ | |
-Dtycho.disableP2Mirrors=true \ | |
-Dtm4e.target-platform=oldest \ | |
-DskipTests=true \ | |
clean verify | |
- name: Perform CodeQL Analysis | |
uses: github/codeql-action/analyze@v3 | |
with: | |
category: "/language:${{matrix.language}}" |