-
-
Notifications
You must be signed in to change notification settings - Fork 26
64 lines (62 loc) · 2.96 KB
/
dev-integration.yaml
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
name: dev-integration
on:
push:
paths:
- 'services/graphql/**'
- 'services/rule/**'
- 'services/request-create/**'
- 'services/request-approve/**'
- 'services/balance-by-account/**'
- 'services/request-by-id/**'
- 'services/requests-by-account/**'
- 'services/transaction-by-id/**'
- 'services/transactions-by-account/**'
- 'migrations/schema/*'
- 'tests/**'
branches:
- 'develop'
jobs:
integration_test:
name: cloud integration test
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
steps:
- uses: actions/checkout@v4
- name: mask values
run: echo "::add-mask::${{ secrets.AWS_ACCOUNT_ID }}"
- name: install latest psql client
run: |
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install --yes --no-install-recommends postgresql-client
- name: install golang-migrate
run: |
curl -LO https://github.com/golang-migrate/migrate/releases/download/v4.15.2/migrate.linux-amd64.deb
sudo dpkg -i migrate.linux-amd64.deb
rm migrate.linux-amd64.deb
- name: deploy to dev cloud environment
run: |
for app in $(bash scripts/list-dir-paths.sh --type app | grep -v client | xargs basename -a); do
# tag newly pushed dev images with develop merge commit sha
bash scripts/tag-merge-commit.sh --app-name $app --env dev --env-id ${{ secrets.DEV_ENV_ID }};
# deploy newly tagged images to dev cloud
bash scripts/deploy-last-image.sh --app-name $app --env dev --env-id ${{ secrets.DEV_ENV_ID }};
done
- name: reset rds database for integration tests
run: ENV_ID=${{ secrets.DEV_ENV_ID }} make --no-print-directory -C ./migrations resetrds ENV=dev DB=test
- name: dump rds database locally for restore between integration tests
run: make --no-print-directory -C ./migrations/dumps dump-rds-testseed
- name: get secrets for dev integration tests
run: ENV_ID=${{ secrets.DEV_ENV_ID }} make --no-print-directory -C ./tests get-secrets ENV=dev
- name: run dev cloud integration tests
run: ENV_ID=${{ secrets.DEV_ENV_ID }} cargo test --manifest-path ./tests/Cargo.toml --features integration_tests -- --test-threads=1
- name: tag and push dev images to prod ecr
run: |
for app in $(bash scripts/list-dir-paths.sh --type app | grep -v client | xargs basename -a); do
# tag newly tested dev images with prod and push to prod ecr
bash scripts/push-prod-image.sh --app-name $app --env dev --env-id ${{ secrets.DEV_ENV_ID }};
done