Skip to content

Commit

Permalink
Build updates (#501)
Browse files Browse the repository at this point in the history
* Update build scripts, update to Java 21, Add maven wrapper, add code coverage

* Fix up windows build
  • Loading branch information
JPercival authored Dec 4, 2023
1 parent 8a2ccc9 commit d246f53
Show file tree
Hide file tree
Showing 8 changed files with 680 additions and 28 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build
on:
push:
branches:
- master

permissions:
contents: write
checks: write

concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
maven:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Publish snapshot
run: ./mvnw --batch-mode -no-transfer-progress --update-snapshots deploy -Ppackage
env:
MAVEN_USERNAME: ${{ vars.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
- name: Publish test report
uses: mikepenz/action-junit-report@v3
if: success() || failure() # always run even if the previous step fails
with:
report_paths: "**/target/surefire-reports/TEST-*.xml"
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
30 changes: 25 additions & 5 deletions .github/workflows/check-pr.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: Check PR
on: pull_request

permissions:
checks: write

concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
maven:
strategy:
Expand All @@ -9,9 +16,22 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
- name: Compile
run: ./mvnw --batch-mode --no-transfer-progress --update-snapshots -T 4 package -DskipTests=true
- name: Tests and additional checks
run: ./mvnw --batch-mode --no-transfer-progress -T 4 verify -Ppackage
- name: Publish test report
uses: mikepenz/action-junit-report@v3
if: success() || failure() # always run even if the previous step fails
with:
distribution: temurin
java-version: 11
- name: Run Checks
run: mvn --batch-mode --no-transfer-progress --update-snapshots verify
report_paths: "**/target/surefire-reports/TEST-*.xml"
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
if: matrix.os == 'ubuntu-latest'
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
23 changes: 0 additions & 23 deletions .github/workflows/publish-snapshot.yml

This file was deleted.

18 changes: 18 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.1/apache-maven-3.8.1-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
20 changes: 20 additions & 0 deletions codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
coverage:
ignore:
- "testfiles"
- "scripts"
status:
project:
default:
target: auto
threshold: 1% # this covers slighty flaky tests
patch:
default:
# basic
target: 80
threshold: 0%
base: auto
# advanced
branches:
- master
if_ci_failed: error #success, failure, error, ignore
only_pulls: false
Loading

0 comments on commit d246f53

Please sign in to comment.