Skip to content

Commit c6e00f5

Browse files
committed
update workflow
1 parent 51bf183 commit c6e00f5

File tree

2 files changed

+22
-13
lines changed

2 files changed

+22
-13
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,8 @@ env:
1111
jobs:
1212
test:
1313
runs-on: ubuntu-latest
14+
uses: ./.github/workflows/common-setup.yml
1415
steps:
15-
- &checkout:
16-
uses: actions/checkout@v4
17-
with:
18-
fetch-depth: 0
19-
- &setupJava:
20-
uses: actions/setup-java@v4
21-
with:
22-
java-version: 17
23-
distribution: temurin
2416
- name: Test
2517
run: ./gradlew test
2618
- name: Upload reports
@@ -36,13 +28,12 @@ jobs:
3628
run: ./gradlew aggregateJacocoReport sonar --stacktrace
3729
integration-test:
3830
runs-on: ubuntu-latest
31+
uses: ./.github/workflows/common-setup.yml
3932
if: ${{ github.ref == 'refs/heads/master' || github.base_ref == 'master' || startsWith(github.ref, 'refs/tags/') }}
4033
strategy:
4134
matrix:
4235
edition: [ "community-231", "enterprise-251" ]
4336
steps:
44-
- <<: *checkout
45-
- <<: *setupJava
4637
- name: Test
4738
run: ./gradlew :integration-tests:alfresco-${{ matrix.edition }}:integrationTest -Prandom_ports=true
4839
- name: Upload reports
@@ -55,9 +46,8 @@ jobs:
5546
needs: [test, integration-test]
5647
runs-on: ubuntu-latest
5748
if: ${{ startsWith(github.ref, 'refs/tags/') }}
49+
uses: ./.github/workflows/common-setup.yml
5850
steps:
59-
- <<: *checkout
60-
- <<: *setupJava
6151
- name: Publish
6252
env:
6353
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.MAVEN_CENTRAL_GPG_KEY }}

.github/workflows/common-setup.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Common Setup
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
setup:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v4
12+
with:
13+
fetch-depth: 0
14+
15+
- name: Setup Java
16+
uses: actions/setup-java@v4
17+
with:
18+
java-version: 17
19+
distribution: temurin

0 commit comments

Comments
 (0)