From afff8c1aef56710c57fef366746b98436d939a75 Mon Sep 17 00:00:00 2001 From: bobbylight Date: Wed, 27 Nov 2024 10:37:35 -0500 Subject: [PATCH] Get CI workflows working again --- .github/workflows/codeql-analysis.yml | 65 +++++++++++++-------------- .github/workflows/gradle.yml | 29 +++++++----- README.md | 4 +- 3 files changed, 53 insertions(+), 45 deletions(-) diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 631fc51b..368f5931 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -34,43 +34,42 @@ jobs: # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed steps: - - name: Checkout repository - uses: actions/checkout@v2 + - name: Checkout repository + uses: actions/checkout@v4 - - name: Set up JDK 17 - uses: actions/setup-java@v2 - with: - java-version: '17' - distribution: 'adopt' + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'temurin' - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v1 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main - ## Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - ## If this step fails, then you should remove it and run the build manually (see below) - #- name: Autobuild - # uses: github/codeql-action/autobuild@v1 + ## Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + ## If this step fails, then you should remove it and run the build manually (see below) + #- name: Autobuild + # uses: github/codeql-action/autobuild@v2 - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl + # ℹī¸ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language + # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language - - name: Build - #run: ./gradlew build --warning-mode all - uses: GabrielBB/xvfb-action@v1 - with: - run: ./gradlew build --warning-mode all - working-directory: ./ #optional + # Note: Assumes we're running on Ubuntu + # https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + - name: Build with Gradle + run: xvfb-run ./gradlew build --warning-mode all + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index b13c0fa9..1a344b1f 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -14,18 +14,27 @@ jobs: runs-on: ubuntu-latest + strategy: + matrix: + java: [ '21', '23' ] + steps: - - uses: actions/checkout@v2 - - name: Set up JDK 17 - uses: actions/setup-java@v2 + - uses: actions/checkout@v4 + + - name: Verify gradle wrapper + uses: gradle/actions/wrapper-validation@v4 + if: matrix.java == '21' + + - name: Set up JDK ${{ matrix.java }} + uses: actions/setup-java@v4 with: - java-version: '17' - distribution: 'adopt' + java-version: ${{ matrix.java }} + distribution: 'temurin' + - name: Grant execute permission for gradlew run: chmod +x gradlew + + # Note: Assumes we're running on Ubuntu + # https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md - name: Build with Gradle - #run: ./gradlew build --warning-mode all - uses: GabrielBB/xvfb-action@v1 - with: - run: ./gradlew build --warning-mode all - working-directory: ./ #optional + run: xvfb-run ./gradlew build --warning-mode all diff --git a/README.md b/README.md index 7ca9c670..4b9d8a6d 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ all unit tests, and create the jar, and run: ./gradlew build installDist java -jar build/install/rtext/RText.jar -Note that RText requires Java 17 or later to build. +Note that RText requires Java 21 or later to build. ### Building the Windows application and installer @@ -40,7 +40,7 @@ and a starter `RText.exe` file is added into `build/install/rtext`: ./gradlew clean build installDist generateWindowsStarterExe -The `generateWindowsStarterExe` task uses a JDK 17 install and `launch4j` as defined in +The `generateWindowsStarterExe` task uses a JDK 21 install and `launch4j` as defined in `gradle.properties`. Note this gradle task runs `jlink` directly and uses `launch4j` rather than using