diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 000000000..0b89ab829 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,42 @@ +name: "CodeQL" + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + schedule: + - cron: "25 11 * * 0" + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + language: [ javascript, java ] + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + queries: +security-and-quality + + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + if: ${{ matrix.language == 'javascript' || matrix.language == 'java' }} + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{ matrix.language }}" diff --git a/server/build.gradle b/server/build.gradle index 07f36da6e..985ec2bf5 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -12,10 +12,10 @@ plugins { id 'checkstyle' } -// Build and run the project with Java 11 +// Build and run the project with Java 21 java { toolchain { - languageVersion = JavaLanguageVersion.of(11) + languageVersion = JavaLanguageVersion.of(21) } } @@ -46,6 +46,9 @@ dependencies { // JUnit Jupiter Engine for testing. testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.1' + // JUnit Platform Launcher for testing. + testRuntimeOnly 'org.junit.platform:junit-platform-launcher' + // Mockito for testing testImplementation 'org.mockito:mockito-core:5.8.0' @@ -75,7 +78,7 @@ jacocoTestReport { // This isn't strictly necessary, but the default reports // location is buried pretty deep in the build directory, // so this makes it easier to find. - html.destination file("${buildDir}/jacocoHtml") + html.outputLocation = file("${buildDir}/jacocoHtml") } afterEvaluate { diff --git a/server/settings.gradle b/server/settings.gradle index 0e6c57337..e5443ab65 100644 --- a/server/settings.gradle +++ b/server/settings.gradle @@ -6,6 +6,13 @@ * Detailed information about configuring a multi-project build in Gradle can be found * in the user manual at https://docs.gradle.org/5.6/userguide/multi_project_builds.html */ +// This allows us to use the jresolver plugin. If we have +// this plugin in place, we can specify a particular JDK version +// in `build.gradle` and Gradle will download it for us if it's +// not already installed on the system. This will hopefully make +// it easier for people to run the project on a broad range of +// computers without having to worry about installing the right +// JDK version. plugins { id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0'