Skip to content

Commit

Permalink
Split workflow in jobs + recycle deploy workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
GPaoloni committed Sep 6, 2022
1 parent abd7a90 commit feb55de
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 15 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/end_to_end_development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,27 @@ on:
changelog:
description: Release Changelog - Add a comment about the changes to be included in this release.
required: true
workflow_call:
secrets:
AWS_ACCESS_KEY_ID:
required: true
AWS_SECRET_ACCESS_KEY:
required: true
AWS_DEFAULT_REGION:
required: true
E2E_DEV_ACCOUNT_SID:
required: true
E2E_DEV_AUTH_TOKEN:
required: true
inputs:
changelog:
description: Release Changelog - Add a comment about the changes to be included in this release.
required: true
send-slack-message:
description: 'Specifies if should send a Slack message at the end of successful run. Defaults to true'
required: false
default: 'true'
type: string

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand Down
44 changes: 29 additions & 15 deletions .github/workflows/plugin-hrm-form-pre-release-qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,32 @@ on:
required: true

jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on

build-and-deploy:
# TODO: remove branch tag (@gian_CHI-1262-p2)
uses: techmatters/flex-plugins/.github/workflows/end_to_end_development.yml@gian_CHI-1262-p2
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
E2E_DEV_ACCOUNT_SID: ${{ secrets.E2E_DEV_ACCOUNT_SID }}
E2E_DEV_AUTH_TOKEN: ${{ secrets.E2E_DEV_AUTH_TOKEN }}
with:
changelog: "Deploying for pre-release ${{ inputs.tag-prefix }}: ${{ inputs.tag-prefix }} (commit ${{ github.sha }})"
send-slack-message: 'false'

run-e2e-tests:
needs: build-and-deploy

runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
# Call main-action to compile and deploy
- name: Executing main-action
uses: ./.github/actions/main-action
with:
account-sid: ${{ secrets.E2E_DEV_ACCOUNT_SID }}
auth-token: ${{ secrets.E2E_DEV_AUTH_TOKEN }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
send-slack-message: 'false'

# Build Playwright
- name: Install e2e-tests dependencies
Expand All @@ -60,7 +63,18 @@ jobs:
name: test-artifacts
path: e2e-tests/test-results

## TODO: test if this is aborted if E2E tests fails
generate-pre-release:
needs: run-e2e-tests

runs-on: ubuntu-latest

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'

# Get latest tag for this version
- name: Get latest tag
Expand Down

0 comments on commit feb55de

Please # to comment.