From d54fa1e2b047fcd17295e0e97080c976874a8348 Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Thu, 16 Dec 2021 18:09:00 +0100 Subject: [PATCH 1/3] GitHub Actions: use composite for setup environment --- .github/actions/setup/action.yml | 23 ++++++++++++ .github/workflows/github-actions.yml | 52 +++++++--------------------- 2 files changed, 36 insertions(+), 39 deletions(-) create mode 100644 .github/actions/setup/action.yml diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml new file mode 100644 index 00000000000..0bcfced3c6a --- /dev/null +++ b/.github/actions/setup/action.yml @@ -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/setup-node@v2.5.0 + 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 diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index b62ff5d6b97..30bcc07426d 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -14,22 +14,9 @@ jobs: steps: - name: 'Setup: checkout project' uses: actions/checkout@v2 - - name: 'Setup: Node.js' - uses: actions/setup-node@v2.5.0 - 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: @@ -63,29 +50,9 @@ jobs: steps: - name: 'Setup: checkout project' uses: actions/checkout@v2 - - name: 'Setup: Node.js' - uses: actions/setup-node@v2.5.0 - 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: @@ -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('/tmp/beer/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- - name: 'Test: Beer project' run: | cd /tmp/beer/ From 265e28549dcb69d6653aa1c093e045fe8ba347f1 Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Thu, 16 Dec 2021 19:05:40 +0100 Subject: [PATCH 2/3] GitHub Actions: change key cache for generation --- .github/workflows/github-actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index 30bcc07426d..daf77374fd8 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -69,7 +69,7 @@ jobs: uses: actions/cache@v2 with: path: ~/.m2/repository - key: ${{ runner.os }}-maven-${{ hashFiles('/tmp/beer/pom.xml') }} + key: ${{ runner.os }}-maven-generation restore-keys: | ${{ runner.os }}-maven- - name: 'Test: Beer project' From aa43acf9132b3615e90c7de726c27b573fba56e7 Mon Sep 17 00:00:00 2001 From: Pascal Grimaud Date: Thu, 16 Dec 2021 19:11:20 +0100 Subject: [PATCH 3/3] GitHub Actions: put old config for cache in generation jobs --- .github/workflows/github-actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml index daf77374fd8..9463d591a03 100644 --- a/.github/workflows/github-actions.yml +++ b/.github/workflows/github-actions.yml @@ -69,7 +69,7 @@ jobs: uses: actions/cache@v2 with: path: ~/.m2/repository - key: ${{ runner.os }}-maven-generation + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} restore-keys: | ${{ runner.os }}-maven- - name: 'Test: Beer project'