Skip to content

Commit 82562ed

Browse files
committed
Move common GH Actions setup to seperate file
1 parent 2694861 commit 82562ed

File tree

2 files changed

+20
-32
lines changed

2 files changed

+20
-32
lines changed

.github/workflows/ci.yml

+4-32
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,7 @@ jobs:
2323
uses: oracle-actions/setup-java@v1
2424
with:
2525
release: ${{ matrix.java }}
26-
- name: Install softhsm2
27-
run: sudo apt-get install -y softhsm2
28-
- name: Install opensc
29-
run: sudo apt-get install -y opensc
30-
- name: Ensure SoftHSM user configuration
31-
run: impl/src/test/scripts/softhsm configure
32-
- name: Populate SoftHSM with JJWT test keys
33-
run: impl/src/test/scripts/softhsm import
26+
- uses: ./.github/workflows/env-setup.yml
3427
- name: Build
3528
# run a full build, just as we would for a release (i.e. the `ossrh` profile), but don't use gpg
3629
# to sign artifacts, since we don't want to mess with storing signing credentials in CI:
@@ -51,14 +44,7 @@ jobs:
5144
distribution: 'temurin'
5245
cache: 'maven'
5346
check-latest: true
54-
- name: Install softhsm2
55-
run: sudo apt-get install -y softhsm2
56-
- name: Install opensc
57-
run: sudo apt-get install -y opensc
58-
- name: Ensure SoftHSM user configuration
59-
run: impl/src/test/scripts/softhsm configure
60-
- name: Populate SoftHSM with JJWT test keys
61-
run: impl/src/test/scripts/softhsm import
47+
- uses: ./.github/workflows/env-setup.yml
6248
- name: Build
6349
# run a full build, just as we would for a release (i.e. the `ossrh` profile), but don't use gpg
6450
# to sign artifacts, since we don't want to mess with storing signing credentials in CI:
@@ -81,14 +67,7 @@ jobs:
8167
distribution: 'zulu'
8268
cache: 'maven'
8369
check-latest: true
84-
- name: Install softhsm2
85-
run: sudo apt-get install -y softhsm2
86-
- name: Install opensc
87-
run: sudo apt-get install -y opensc
88-
- name: Ensure SoftHSM user configuration
89-
run: impl/src/test/scripts/softhsm configure
90-
- name: Populate SoftHSM with JJWT test keys
91-
run: impl/src/test/scripts/softhsm import
70+
- uses: ./.github/workflows/env-setup.yml
9271
- name: Build
9372
# run a full build, just as we would for a release (i.e. the `ossrh` profile), but don't use gpg
9473
# to sign artifacts, since we don't want to mess with storing signing credentials in CI:
@@ -129,14 +108,7 @@ jobs:
129108
java-version: '8'
130109
cache: 'maven'
131110
check-latest: true
132-
- name: Install softhsm2
133-
run: sudo apt-get install -y softhsm2
134-
- name: Install opensc
135-
run: sudo apt-get install -y opensc
136-
- name: Ensure SoftHSM user configuration
137-
run: impl/src/test/scripts/softhsm configure
138-
- name: Populate SoftHSM with JJWT test keys
139-
run: impl/src/test/scripts/softhsm import
111+
- uses: ./.github/workflows/env-setup.yml
140112
- name: Wait to start
141113
# wait a little to start: code coverage usually only takes about 1 1/2 minutes. If coverage fails, it will
142114
# cancel the other running builds, and we don't want that (because we want to see if jobs fail due to

.github/workflows/env-setup.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
on:
2+
# Reusable GitHub Action
3+
workflow_call:
4+
5+
jobs:
6+
setup_env:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Install softhsm2
10+
run: sudo apt-get install -y softhsm2
11+
- name: Install opensc
12+
run: sudo apt-get install -y opensc
13+
- name: Ensure SoftHSM user configuration
14+
run: impl/src/test/scripts/softhsm configure
15+
- name: Populate SoftHSM with JJWT test keys
16+
run: impl/src/test/scripts/softhsm import

0 commit comments

Comments
 (0)