Skip to content

Commit

Permalink
Merge pull request #328 from pascalgrimaud/github-actions-composite
Browse files Browse the repository at this point in the history
GitHub Actions: use composite for setup environment
  • Loading branch information
pascalgrimaud authored Dec 16, 2021
2 parents e2fa5c7 + aa43acf commit 5549574
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 39 deletions.
23 changes: 23 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 'Setup'
description: 'Setup environment with Java 17, Node 16.13.1'
runs:
using: 'composite'
steps:
- name: 'Setup: Node.js'
uses: actions/[email protected]
with:
node-version: 16.13.1
- name: 'Setup: update NPM'
shell: bash
run: npm install -g npm
- name: 'Setup: Java 17'
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '17.x'
- name: 'Setup: check tools'
shell: bash
run: |
node -v
npm -v
java -version
52 changes: 13 additions & 39 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,9 @@ jobs:
steps:
- name: 'Setup: checkout project'
uses: actions/checkout@v2
- name: 'Setup: Node.js'
uses: actions/[email protected]
with:
node-version: 16.13.0
- name: 'Setup: update npm'
run: npm install -g npm
- name: 'Setup: Java 17'
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '17.x'
- name: 'Setup: check tools'
run: |
node -v
npm -v
java -version
- name: 'Setup: environment'
id: setup
uses: ./.github/actions/setup
- name: 'Init: cache local Maven repository'
uses: actions/cache@v2
with:
Expand Down Expand Up @@ -63,29 +50,9 @@ jobs:
steps:
- name: 'Setup: checkout project'
uses: actions/checkout@v2
- name: 'Setup: Node.js'
uses: actions/[email protected]
with:
node-version: 16.13.0
- name: 'Setup: update npm'
run: npm install -g npm
- name: 'Setup: Java 17'
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '17.x'
- name: 'Setup: check tools'
run: |
node -v
npm -v
java -version
- name: 'Init: cache local Maven repository'
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: 'Setup: environment'
id: setup
uses: ./.github/actions/setup
- name: 'Artifact: download JAR'
uses: actions/download-artifact@v2
with:
Expand All @@ -98,6 +65,13 @@ jobs:
./generate.sh
ls -al /tmp/beer/
./stop.sh
- name: 'Init: cache local Maven repository'
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: 'Test: Beer project'
run: |
cd /tmp/beer/
Expand Down

0 comments on commit 5549574

Please sign in to comment.