From 7db66d08136870f3f20bf1f1c3e7ead4ec1971f4 Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Sun, 28 Jan 2024 13:44:22 -0600 Subject: [PATCH] Add GitHub workflows --- .github/workflows/codeql-analysis.yml | 47 +++++++++++++++++++++++++++ .github/workflows/gradle.yml | 26 +++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 .github/workflows/codeql-analysis.yml create mode 100644 .github/workflows/gradle.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..17fac60 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,47 @@ +name: "CodeQL" + +on: + push: + branches: [ master ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ master ] + schedule: + - cron: '30 4 * * *' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ 'java' ] + java: [ 17 ] + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up JDK ${{ matrix.java }} + uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: ${{ matrix.java }} + cache: gradle + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 0000000..47fb35d --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,26 @@ +# Adapted from Paper's build script +name: Build +on: [ push, pull_request ] + +jobs: + build: + # Only run on PRs if the source branch is on someone else's repo + if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }} + runs-on: ubuntu-latest + strategy: + matrix: + java: [ 17 ] + fail-fast: true + steps: + - uses: actions/checkout@v3 + - name: JDK ${{ matrix.java }} + uses: actions/setup-java@v3 + with: + java-version: ${{ matrix.java }} + cache: 'gradle' + distribution: 'temurin' + - name: Build + run: | + git config --global user.email "no-reply@github.com" + git config --global user.name "Github Actions" + ./gradlew build --stacktrace