Skip to content

Commit

Permalink
Merge pull request #1589 from rjhancock/codeql-enhancements
Browse files Browse the repository at this point in the history
Slimmed down CodeQL
  • Loading branch information
rjhancock authored Aug 10, 2024
2 parents e9c8ae3 + 126e393 commit fc321e4
Showing 1 changed file with 9 additions and 53 deletions.
62 changes: 9 additions & 53 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,72 +5,28 @@ on:
branches: [master]
pull_request:
branches: [master]
schedule:
- cron: "24 16 * * 4"
paths-ignore:
- "**/*.mtf"
- "**/*.blk"
- "**/*.pdf"

jobs:
analyze:
name: Analyze
runs-on: ${{ matrix.os }}

outputs:
mmRepo: ${{ steps.find_mm.outputs.mmRepo }}
mmBranch: ${{ steps.find_mm.outputs.mmBranch }}

strategy:
matrix:
os: [ubuntu-latest]
language: ["java"]
java-distribution: [temurin]
java-version: [17]
fail-fast: false
runs-on: [ubuntu-latest]

steps:
- name: Checkout MegaMekLab
- name: "Check out MegaMekLab"
uses: actions/checkout@v4
with:
path: megameklab

- name: Find the Right MegaMek Branch
id: find_mm
shell: bash {0}
run: |
git ls-remote --exit-code --heads ${{ github.event.pull_request.head.repo.owner.html_url }}/megamek.git ${{ github.event.pull_request.head.ref }}
if [ "$?" == "0" ]
then
echo "mmRepo=${{ github.event.pull_request.head.repo.owner.login }}/megamek" >> $GITHUB_OUTPUT
echo "mmBranch=${{ github.event.pull_request.head.ref }}" >> $GITHUB_OUTPUT
else
echo "mmRepo=MegaMek/megamek" >> $GITHUB_OUTPUT
echo "mmBranch=master" >> $GITHUB_OUTPUT
fi
exit 0
- name: Checkout MegaMek
uses: actions/checkout@v4
with:
repository: ${{ steps.find_mm.outputs.mmRepo }}
ref: ${{ steps.find_mm.outputs.mmBranch }}
path: megamek

- name: Set up ${{ matrix.java-distribution }} JDK ${{ matrix.java-version }}
uses: actions/setup-java@v4
with:
distribution: ${{ matrix.java-distribution }}
java-version: ${{ matrix.java-version }}

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Build with Gradle
working-directory: megameklab
run: ./gradlew jar
languages: java-kotlin
build-mode: none
queries: security-and-quality

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3

0 comments on commit fc321e4

Please sign in to comment.