Skip to content

Commit

Permalink
ci: minor changes to GitHub Actions workflows
Browse files Browse the repository at this point in the history
- unique job name for workflow checking PRs
- use pinned action dependencies
- remove checkout task (since included in setup-maven task)
  • Loading branch information
stempler committed Apr 22, 2024
1 parent c5b75ab commit 6f0c047
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 33 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
name: Pull Request Workflow
name: Check

on:
pull_request:
branches:
- '*' # Trigger on all branches for pull requests

jobs:
build:
check:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Maven
uses: s4u/setup-maven-action@v1.5.1
uses: s4u/setup-maven-action@4fdbe2a6a718a03bf4874636eed4311886cab6ba # v1.5.1
with:
java-version: 17
java-distribution: temurin
Expand All @@ -29,7 +26,7 @@ jobs:
working-directory: ./build

- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
uses: mikepenz/action-junit-report@9379f0ccddcab154835d4e2487555ee79614fe95 # v4.2.1
if: always() # always run even if the previous step fails
with:
# fail if there are no test results
Expand All @@ -41,3 +38,6 @@ jobs:
annotate_only: true
detailed_summary: true
report_paths: 'build/target/testReports/*.xml'

# TODO archive logs?
# build/target/testReports/*.out,build/target/testReports/*.err
21 changes: 9 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
name: Master Branch Workflow
name: Publish

on:
push:
branches:
#- master # Trigger on pushes to the master branch
- build/ING-4164
- master
workflow_dispatch: {}

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Maven
uses: s4u/setup-maven-action@v1.5.1
uses: s4u/setup-maven-action@4fdbe2a6a718a03bf4874636eed4311886cab6ba # v1.5.1
with:
java-version: 17
java-distribution: temurin
Expand Down Expand Up @@ -46,10 +42,11 @@ jobs:
working-directory: ./build

- name: Product
run: ./build.sh product --arch x86_64 --os linux HALE
./build.sh product --arch x86_64 --os windows HALE
./build.sh product --arch x86_64 --os macosx HALE
./build.sh product --arch x86_64 --os linux --publish Infocenter
run: |
./build.sh product --arch x86_64 --os linux HALE
./build.sh product --arch x86_64 --os windows HALE
./build.sh product --arch x86_64 --os macosx HALE
./build.sh product --arch x86_64 --os linux --publish Infocenter
working-directory: ./build

- name: Install AWS CLI
Expand All @@ -69,7 +66,7 @@ jobs:
working-directory: ./build

- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
uses: mikepenz/action-junit-report@9379f0ccddcab154835d4e2487555ee79614fe95 # v4.2.1
if: always() # always run even if the previous step fails
with:
# fail if there are no test results
Expand Down
34 changes: 20 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
name: Release Branch Workflow
name: Publish release

#
# Release workflow
#
# Open tasks:
# - [ ] can we build the Windows installer?
# - [ ] can we integrate semantic-release? (e.g. update versions, create tag, changelog, create GitHub release + upload artifacts)
#

on:
push:
branches:
- release/* # Trigger on pushes to the master branch
# push:
# branches:
# - release
workflow_dispatch: {}

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Maven
uses: s4u/setup-maven-action@v1.5.1
uses: s4u/setup-maven-action@4fdbe2a6a718a03bf4874636eed4311886cab6ba # v1.5.1
with:
java-version: 17
java-distribution: temurin
Expand Down Expand Up @@ -46,10 +51,11 @@ jobs:
working-directory: ./build

- name: Product
run: ./build.sh product --arch x86_64 --os linux HALE
./build.sh product --arch x86_64 --os windows HALE
./build.sh product --arch x86_64 --os macosx HALE
./build.sh product --arch x86_64 --os linux --publish Infocenter
run: | # TODO should --latest parameter be added for building Infocenter?
./build.sh product --arch x86_64 --os linux HALE
./build.sh product --arch x86_64 --os windows HALE
./build.sh product --arch x86_64 --os macosx HALE
./build.sh product --arch x86_64 --os linux --publish Infocenter
working-directory: ./build

- name: Install AWS CLI
Expand All @@ -66,7 +72,7 @@ jobs:
working-directory: ./build

- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
uses: mikepenz/action-junit-report@9379f0ccddcab154835d4e2487555ee79614fe95 # v4.2.1
if: always() # always run even if the previous step fails
with:
# fail if there are no test results
Expand All @@ -77,4 +83,4 @@ jobs:
# See https://github.com/mikepenz/action-junit-report/issues/40
annotate_only: true
detailed_summary: true
report_paths: 'build/target/testReports/*.xml'
report_paths: 'build/target/testReports/*.xml'

0 comments on commit 6f0c047

Please sign in to comment.