summaryrefslogtreecommitdiff
path: root/.github/workflows/build.yml
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2023-01-09 22:04:46 +0100
committerGitHub <noreply@github.com>2023-01-09 22:04:46 +0100
commitb68af696cc6a10df356dee6b347d1b607707035a (patch)
tree54f52705ee9c6d56e7c190be70a74a7eb4a54f5b /.github/workflows/build.yml
parent3542350909b1213240e5097a1793a7c0733f6196 (diff)
parent8d94287bdc5af03485ed85fee1aab7809dc53566 (diff)
merge: Update GitHub Actions workflows (#123)
This pull request updates the GitHub Actions workflows used in the OpenDC repository, addressing (impending) deprecations, broken caching and publishing steps. ## Implementation Notes :hammer_and_pick: * Fix GH Actions workflow for publishing Docker images * Enable Gradle caching on master branch * Pin version of GitHub Actions runner images * Publish to Maven Central in publish workflow * Upload distributions after CI build
Diffstat (limited to '.github/workflows/build.yml')
-rw-r--r--.github/workflows/build.yml24
1 files changed, 16 insertions, 8 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 96b86233..255815f5 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -12,10 +12,10 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
- os: [ ubuntu-latest ]
+ os: [ ubuntu-22.04 ]
java: [ 17, 19 ]
include:
- - os: windows-latest
+ - os: windows-2022
java: 17
steps:
- name: Checkout repository
@@ -30,10 +30,10 @@ jobs:
- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
- arguments: build codeCoverageReport
- # Only write to the cache for builds on the 'main' branch.
+ arguments: build assembleDist codeCoverageReport
+ # Only write to the cache for builds on the 'master' branch.
# Builds on other branches will only read existing entries from the cache.
- cache-read-only: ${{ github.ref != 'refs/heads/main' }}
+ cache-read-only: ${{ github.ref != 'refs/heads/master' }}
- name: Publish report
if: always()
uses: mikepenz/action-junit-report@v3
@@ -41,7 +41,7 @@ jobs:
check_name: test (Java ${{ matrix.java }})
report_paths: '**/build/test-results/test/TEST-*.xml'
github_token: ${{ secrets.GITHUB_TOKEN }}
- - name: Upload artifacts
+ - name: Upload reports
if: always()
continue-on-error: true # See https://github.com/actions/upload-artifact/issues/270
uses: actions/upload-artifact@v3
@@ -51,6 +51,14 @@ jobs:
./**/build/reports/**/*
./**/build/test-results/**/*
retention-days: 5
+ - name: Upload build
+ continue-on-error: true
+ uses: actions/upload-artifact@v3
+ with:
+ name: build-${{ matrix.os }}-jdk${{ matrix.java }}
+ path: |
+ ./**/build/distributions/**/*.zip
+ retention-days: 5
- name: Upload code coverage
uses: codecov/codecov-action@v3
with:
@@ -58,7 +66,7 @@ jobs:
files: ./build/reports/jacoco/codeCoverageReport/codeCoverageReport.xml
build-docker:
name: Build Docker Images
- runs-on: ubuntu-latest
+ runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v3
@@ -80,7 +88,7 @@ jobs:
run:
working-directory: site
name: Build Docs
- runs-on: ubuntu-latest
+ runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3