Skip to content

Commit

Permalink
Merge branch 'main' into updateGraph
Browse files Browse the repository at this point in the history
  • Loading branch information
dkontyko authored Feb 11, 2024
2 parents b8a0949 + 47b23b5 commit c5731f4
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 24 deletions.
34 changes: 21 additions & 13 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,46 @@ env:
PACKAGE_DIRECTORY: 'FunctionApp'

jobs:
changes:
checkChanges:
uses: ./.github/workflows/filter-changes.yml

build:
needs: changes
if: ${{ needs.changes.outputs.function-app == true }}
uses: ./.github/workflows/maven.yml

analyze:
needs: build
if: ${{ success() }}
needs: checkChanges
if: ${{ needs.checkChanges.outputs.functionApp == 'true' }}
name: Analyze
runs-on: windows-latest
timeout-minutes: 30
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'java' ]
language: [ 'java-kotlin' ]

steps:
- name: Checkout Code
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}

# AFAIk, this is unavaoidable, since the CodeQL actions
# must be run in the same job as build actions.
- name: Setup Java Sdk ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v4
with:
distribution: 'microsoft'
java-version: ${{ env.JAVA_VERSION }}
cache: maven

- name: Build with Maven
run: mvn -B package --file ${{ env.PACKAGE_DIRECTORY }}/pom.xml

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
10 changes: 7 additions & 3 deletions .github/workflows/filter-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,26 @@ name: "Filter Changes"
on:
workflow_dispatch:
workflow_call:
outputs:
functionApp:
description: "Whether the FunctionApp directory has changed"
value: ${{ jobs.changes.outputs.functionApp }}

jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
function-app: ${{ steps.filter.outputs.function-app }}
functionApp: ${{ steps.filter.outputs.functionApp }}
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v4

- name: filter
id: filter
uses: dorny/paths-filter@v2
uses: dorny/paths-filter@v3
with:
filters: |
function-app:
functionApp:
- 'FunctionApp/**'
9 changes: 1 addition & 8 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,11 @@ jobs:
uses: actions/checkout@v4

- name: Setup Java Sdk ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'microsoft'
java-version: ${{ env.JAVA_VERSION }}
cache: maven

- name: 'Restore Project Dependencies Using Mvn'
shell: pwsh
run: |
pushd './${{ env.PACKAGE_DIRECTORY }}'
mvn clean package
popd
- name: Build with Maven
run: mvn -B package --file ${{ env.PACKAGE_DIRECTORY }}/pom.xml

0 comments on commit c5731f4

Please sign in to comment.