generated from Sage-Bionetworks/aws-application-deployment-template
-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (46 loc) · 1.42 KB
/
main.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
name: main
on:
pull_request:
branches: ['*']
push:
branches: ['*']
concurrency: ci-${{ github.ref }}
jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Static Analysis
uses: pre-commit/[email protected]
- name: Install dependencies
run: pip install -r requirements.txt -r requirements-dev.txt
- name: Run unit tests
run: python -m pytest tests/ -s -v
# make sure tests pass for both dev and prod stacks
synth-test:
needs: tests
strategy:
matrix:
stack: ['dev', 'prod']
uses: "./.github/workflows/synth-test.yml"
with:
CONTEXT: ${{ matrix.stack }}
cdk-deploy-dev:
# only run on a push/merge, not on a PR
if: ${{ github.ref_name == 'dev' }}
needs: [tests, synth-test]
uses: "./.github/workflows/aws-deploy.yml"
secrets: inherit
with:
CONTEXT: ${{ github.ref_name }}
ROLE_TO_ASSUME: arn:aws:iam::449435941126:role/sagebase-github-oidc-sage-bionetworks-synapse-docker-registry
cdk-deploy-prod:
# only run on a push/merge, not on a PR
if: ${{ github.ref_name == 'prod' }}
needs: [tests, synth-test]
uses: "./.github/workflows/aws-deploy.yml"
secrets: inherit
with:
CONTEXT: ${{ github.ref_name }}
ROLE_TO_ASSUME: arn:aws:iam::325565585839:role/sagebase-github-oidc-sage-bionetworks-synapse-docker-registry