Skip to content

Commit 6fb1e60

Browse files
authored
Merge pull request #319 from jfdenise/main
Only run previous wildfly releases nightly jobs if changes occured
2 parents 4b26083 + 0092265 commit 6fb1e60

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

.github/workflows/nightly-workflow-jdk11.yml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,25 @@ on:
1111
required: false
1212
default: "main"
1313
type: string
14-
jobs:
14+
jobs:
15+
check_date:
16+
runs-on: ubuntu-latest
17+
name: Check latest commit
18+
outputs:
19+
should_run: ${{ steps.should_run.outputs.should_run }}
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: print latest_commit
23+
run: echo ${{ github.sha }}
24+
- id: should_run
25+
continue-on-error: true
26+
name: check latest commit is less than a day
27+
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false"
1528
galleon-plugins-build:
1629
name: galleon-plugins-${{ matrix.os }}-jdk${{ matrix.java }}
1730
runs-on: ${{ matrix.os }}
31+
needs: check_date
32+
if: ${{ needs.check_date.outputs.should_run != 'false' }}
1833
outputs:
1934
galleon-plugins-version: ${{ steps.version.outputs.galleon-plugins-version }}
2035
galleon-version: ${{ steps.version.outputs.galleon-version }}
@@ -59,18 +74,21 @@ jobs:
5974
wildfly-build-and-test:
6075
name: Linux/Windows - JDK11 and JDK17
6176
uses: wildfly/wildfly/.github/workflows/shared-wildfly-build-and-test.yml@34.0.0.Final
77+
needs: [check_date, galleon-plugins-build]
78+
if: ${{ needs.check_date.outputs.should_run != 'false' }}
6279
with:
6380
build-arguments: '-fae -Dversion.org.jboss.galleon=${{needs.galleon-plugins-build.outputs.galleon-version}} -Dversion.org.wildfly.galleon-plugins=${{needs.galleon-plugins-build.outputs.galleon-plugins-version}} -Dversion.org.wildfly.plugin=5.1.0.Alpha2 -Dversion.org.wildfly.wildfly-channel-plugin=1.0.20 -Dversion.org.wildfly.bom-builder-plugin=2.0.8.Final'
6481
java-versions: "['11', '17']"
6582
os: "['ubuntu-latest', 'windows-latest']"
6683
maven-repo-name: galleon-plugins-maven-repository
6784
maven-repo-path: galleon-plugins-maven-repository.tar.gz
6885
ref: ${{ inputs.wildfly-ref }}
69-
needs: galleon-plugins-build
7086

7187
wildfly-build-and-test-galleon-layers:
7288
name: Galleon Linux - JDK11
7389
uses: wildfly/wildfly/.github/workflows/shared-wildfly-build-and-test.yml@34.0.0.Final
90+
needs: [check_date, galleon-plugins-build]
91+
if: ${{ needs.check_date.outputs.should_run != 'false' }}
7492
with:
7593
test-arguments: '-fae -Dts.layers -Dts.galleon'
7694
build-arguments: '-Dversion.org.jboss.galleon=${{needs.galleon-plugins-build.outputs.galleon-version}} -Dversion.org.wildfly.galleon-plugins=${{needs.galleon-plugins-build.outputs.galleon-plugins-version}} -Dversion.org.wildfly.plugin=5.1.0.Alpha2 -Dversion.org.wildfly.wildfly-channel-plugin=1.0.20 -Dversion.org.wildfly.bom-builder-plugin=2.0.8.Final'
@@ -79,11 +97,12 @@ jobs:
7997
maven-repo-name: galleon-plugins-maven-repository
8098
maven-repo-path: galleon-plugins-maven-repository.tar.gz
8199
ref: ${{ inputs.wildfly-ref }}
82-
needs: galleon-plugins-build
83100

84101
wildfly-build-and-test-preview:
85102
name: WildFly Preview - Linux- JDK17
86103
uses: wildfly/wildfly/.github/workflows/shared-wildfly-build-and-test.yml@34.0.0.Final
104+
needs: [check_date, galleon-plugins-build]
105+
if: ${{ needs.check_date.outputs.should_run != 'false' }}
87106
with:
88107
test-arguments: '-fae -Dts.preview'
89108
build-arguments: '-Dversion.org.jboss.galleon=${{needs.galleon-plugins-build.outputs.galleon-version}} -Dversion.org.wildfly.galleon-plugins=${{needs.galleon-plugins-build.outputs.galleon-plugins-version}} -Dversion.org.wildfly.plugin=5.1.0.Alpha2 -Dversion.org.wildfly.wildfly-channel-plugin=1.0.20 -Dversion.org.wildfly.bom-builder-plugin=2.0.8.Final'
@@ -92,11 +111,12 @@ jobs:
92111
maven-repo-name: galleon-plugins-maven-repository
93112
maven-repo-path: galleon-plugins-maven-repository.tar.gz
94113
ref: ${{ inputs.wildfly-ref }}
95-
needs: galleon-plugins-build
96114

97115
datasources-build-and-test:
98116
name: WildFly Datasources galleon-pack build and test
99117
runs-on: ${{ matrix.os }}
118+
needs: [check_date, galleon-plugins-build]
119+
if: ${{ needs.check_date.outputs.should_run != 'false' }}
100120
strategy:
101121
fail-fast: false
102122
matrix:
@@ -129,4 +149,3 @@ jobs:
129149
with:
130150
name: surefire-reports-${{ matrix.os }}-${{ matrix.java }}
131151
path: '**/surefire-reports/*.txt'
132-
needs: galleon-plugins-build

0 commit comments

Comments
 (0)