-
Notifications
You must be signed in to change notification settings - Fork 3
151 lines (130 loc) · 5.37 KB
/
hrm-qa-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# Copyright (C) 2021-2023 Technology Matters
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see https://www.gnu.org/licenses/.
# Workflow to create a new pre-release with qa suffix
name: 'Create a QA candidate release'
# Controls when the action will run.
on:
workflow_dispatch:
inputs:
tag-prefix:
description: Release tag name.
required: true
title:
description: Release title - The title that will be given to this pre-release.
required: true
flex-branch:
description: The branch name or tag to run flex-plugins/e2e-tests - Defaults to master.
required: false
default: master
jobs:
build-and-deploy-service:
uses: ./.github/workflows/hrm-ecs-deploy.yml
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
with:
send-slack-message: 'false'
environment: 'development'
build-and-deploy-lambdas:
strategy:
matrix:
lambda_path:
- hrm-domain/lambdas/files-urls
- hrm-domain/lambdas/contact-retrieve-transcript
- hrm-domain/lambdas/search-index-consumer
- lambdas/job-complete
- resources-domain/lambdas/import-consumer
- resources-domain/lambdas/import-producer
- resources-domain/lambdas/search-index
uses: ./.github/workflows/hrm-lambda-deploy.yml
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
with:
send-slack-message: 'false'
environment: 'development'
lambda_path: ${{ matrix.lambda_path }}
run-e2e-tests:
needs:
- build-and-deploy-service
- build-and-deploy-lambdas
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
# Clone flex-plugins repo
- name: Clone flex-plugins repo
run: git clone https://github.com/techmatters/flex-plugins --branch ${{ inputs.flex-branch }} --single-branch
shell: bash
- name: Install Flex Plugin
uses: ./flex-plugins/.github/actions/install-flex-plugin
with:
path: ./flex-plugins
# Build Playwright
- name: Install e2e-tests dependencies
run: npm ci
working-directory: ./flex-plugins/e2e-tests
- name: Setup dependencies for playwright/browsers
uses: microsoft/playwright-github-action@v1
- name: Install Playwright CLI
run: npx playwright install
working-directory: ./flex-plugins/e2e-tests
# Run E2E tests against actual E2E Flex instance
- name: Run Playwright tests
run: npm run test:development:e2e
working-directory: ./flex-plugins/e2e-tests
# Upload artifacts
# TODO: this is not working and cant tell why :(
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: test-artifacts
path: flex-plugins/e2e-tests/test-results
# TODO: move to an action so that can be shared across repos
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@v4
- name: Create pre release
# TODO: remove branch tag
uses: techmatters/flex-plugins/.github/actions/generate-pre-release@master
with:
tag-prefix: ${{ inputs.tag-prefix }}
tag-suffix: 'qa'
title: ${{ inputs.title }}
repository: ${{ github.repository }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
id: create_pre_release
## TODO: Abstract all of this in a custom action reused across repos?
- name: Slack aselo-deploys channel
uses: techmatters/flex-plugins/.github/actions/notify-deploys@master
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
slack-message: '`[HRM]` Release from ${{ github.ref_type }} `${{ github.ref_name }}` requested by `${{ github.triggering_actor }}` completed with SHA ${{ github.sha }}. Release tag is `${{ steps.create_pre_release.outputs.generated-pre-release-tag }}` :rocket:.'
env:
SLACK_BOT_TOKEN: ${{ env.GITHUB_ACTIONS_SLACK_BOT_TOKEN }}