-
Notifications
You must be signed in to change notification settings - Fork 89
110 lines (98 loc) · 3.75 KB
/
manual-cloud-test.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
name: manual test (cloud)
on:
workflow_dispatch:
inputs:
RESOLVE_REF:
description: 'Resolve branch, tag or SHA'
required: true
default: 'dev'
jobs:
verify:
runs-on: ubuntu-latest
steps:
- name: Cancel previous run (if any)
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.RESOLVE_REF }}
- uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install
run: |
yarn install --frozen-lockfile
yarn validate-lock-file
- name: Publish to private repository
id: publish
uses: reimagined/github-actions/publish@v1
with:
registry: github
token: ${{ secrets.RESOLVE_BOT_PAT }}
version: auto
build: ${{ github.sha }}
tag: cloud-test
unpublish: ${{ secrets.UNPUBLISH_TEST_PACKAGES }}
github_target_repository: resolve-js/resolve
- name: Checkout cloud environment
uses: actions/checkout@v2
with:
repository: reimagined/resolve-cloud
ref: dev
token: ${{ secrets.RESOLVE_BOT_PAT }}
path: resolve-cloud
- name: Install cloud environment
id: install_cloud
uses: reimagined/github-actions/install-cloud@v1
with:
aws_access_key_id: ${{ secrets.TEST_CLOUD_AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.TEST_CLOUD_AWS_SECRET_ACCESS_KEY }}
stage: framework-test
version: ${{ steps.publish.outputs.version }}
source: ./resolve-cloud
registry: ${{ steps.publish.outputs.registry_url }}
token: ${{ secrets.RESOLVE_BOT_PAT }}
scopes: '@resolve-js'
- name: Prepare test application
run: |
test_app_dir=$(mktemp -d -t test-app-XXXXXXXXX)
echo "test_app_dir=${test_app_dir}" >> $GITHUB_ENV
cp -rf ./functional-tests/app/. ${test_app_dir}
cd ${test_app_dir}
rm -rf node_modules
- name: Build initial events
env:
TEST_APP_DIR: ${{ env.test_app_dir }}
EVENT_STORE_PATH: ./test-event-store
run: |
yarn ts-node functional-tests/utils/generateEvents.ts
- name: Deploy test app to the cloud
id: deploy
uses: reimagined/github-actions/deploy@v1
with:
source: ${{ env.test_app_dir }}
cloud_api_url: ${{ steps.install_cloud.outputs.api_url}}
cloud_user: ${{ secrets.RESOLVE_CLOUD_USER }}
cloud_token: ${{ secrets.RESOLVE_CLOUD_TOKEN }}
cli_sources: resolve-cloud/cli/resolve-cloud
framework_version: ${{ steps.publish.outputs.version }}
framework_scope: '@resolve-js'
randomize_name: true
package_registry: ${{ steps.publish.outputs.registry_url }}
package_registry_token: ${{ secrets.RESOLVE_BOT_PAT }}
package_registry_scopes: '@resolve-js'
deploy_args: --verbosity=debug --env=DEBUG=resolve:* --env=DEBUG_LEVEL=debug
event_store_path: ./test-event-store
- name: Test:functional (API)
env:
AWS_ACCESS_KEY_ID: ${{ secrets.TEST_CLOUD_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.TEST_CLOUD_AWS_SECRET_ACCESS_KEY }}
AWS_REGION: eu-central-1
RESOLVE_TESTS_TARGET_DEPLOYMENT_ID: ${{ steps.deploy.outputs.id }}
RESOLVE_TESTS_TARGET_VERSION: ${{ steps.publish.outputs.version }}
RESOLVE_TESTS_TARGET_STAGE: framework-test
DEBUG_LEVEL: error
run: |
cd functional-tests
yarn run-test api --url=${{ steps.deploy.outputs.url }}