Skip to content

Commit

Permalink
Try faster actions
Browse files Browse the repository at this point in the history
  • Loading branch information
gwenneg committed Nov 11, 2023
1 parent 69a3245 commit 984dfe9
Showing 1 changed file with 68 additions and 20 deletions.
88 changes: 68 additions & 20 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: Build & Test
on: [push, pull_request, workflow_dispatch]

jobs:
build:
name: Build
not-connectors:
name: aggregator, backend, engine, recipients-resolver
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand All @@ -21,30 +21,13 @@ jobs:
path: ~/.m2/repository
# The cache key is changed every month to prevent unlimited growth.
key: maven-cache-${{ steps.cache-key.outputs.date }}
- name: Cache Yarn dependencies
uses: actions/cache@v3
with:
path: ~/.cache/yarn
# The cache key is changed every month to prevent unlimited growth.
key: yarn-cache-${{ steps.cache-key.outputs.date }}
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: 17
- name: Verify if admin-console changed
id: admin-console-changed
uses: tj-actions/[email protected]
with:
files: admin-console
- name: Build admin-console
if: steps.admin-console-changed.outputs.any_changed == 'true'
run: ./mvnw clean verify -Padmin-console -pl :checkstyle,:notifications-admin-console --no-transfer-progress
- name: Push admin-console
if: steps.admin-console-changed.outputs.any_changed == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/master'
run: bash .github/scripts/push-admin-console.sh
- name: Build with Maven
run: ./mvnw clean verify --no-transfer-progress
run: ./mvnw clean verify -am -ntp -pl :notifications-aggregator,:notifications-backend,:notifications-engine,:notifications-recipients-resolver
- name: Pushes coverage
run: bash <(curl -s https://codecov.io/bash)
- uses: actions/upload-artifact@v3
Expand All @@ -59,3 +42,68 @@ jobs:
backend/target/api/private/v1/openapi.json
backend/target/api/private/v2/openapi.json
backend/target/internal/openapi.json
connectors:
name: connector-*
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Prepare cache key
id: cache-key
shell: bash
run: echo "::set-output name=date::$(/bin/date -u "+%Y-%m")"
- name: Cache Maven dependencies
uses: actions/cache@v3
with:
path: ~/.m2/repository
# The cache key is changed every month to prevent unlimited growth.
key: maven-cache-${{ steps.cache-key.outputs.date }}
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: 17
- name: Build with Maven
run: ./mvnw clean verify -am -amd -ntp -pl :notifications-connector-common
- name: Pushes coverage
run: bash <(curl -s https://codecov.io/bash)
admin-console:
name: admin-console
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Verify if admin-console changed
id: admin-console-changed
uses: tj-actions/[email protected]
with:
files: admin-console
- name: Prepare cache key
if: steps.admin-console-changed.outputs.any_changed == 'true'
id: cache-key
shell: bash
run: echo "::set-output name=date::$(/bin/date -u "+%Y-%m")"
- name: Cache Maven dependencies
if: steps.admin-console-changed.outputs.any_changed == 'true'
uses: actions/cache@v3
with:
path: ~/.m2/repository
# The cache key is changed every month to prevent unlimited growth.
key: maven-cache-${{ steps.cache-key.outputs.date }}
- name: Cache Yarn dependencies
if: steps.admin-console-changed.outputs.any_changed == 'true'
uses: actions/cache@v3
with:
path: ~/.cache/yarn
# The cache key is changed every month to prevent unlimited growth.
key: yarn-cache-${{ steps.cache-key.outputs.date }}
- name: Build admin-console
if: steps.admin-console-changed.outputs.any_changed == 'true'
run: ./mvnw clean verify -Padmin-console -pl :checkstyle,:notifications-admin-console --no-transfer-progress
- name: Push admin-console
if: steps.admin-console-changed.outputs.any_changed == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/master'
run: bash .github/scripts/push-admin-console.sh

0 comments on commit 984dfe9

Please sign in to comment.