78 lines (68 loc) · 2.11 KB
/
static.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
name: Static
on:
workflow_call:
inputs:
test-setup-command:
type: string
description: Command to run to setup the test environment
required: false
default: ""
env:
DEEPSOURCE_DSN: "${{ secrets.DEEPSOURCE_DSN }}"
NODE_AUTH_TOKEN: ${{ secrets.NPM_READONLY_TOKEN }}
CC_TEST_REPORTER_ID: ${{ secrets.CODE_CLIMATE_KEY }}
jobs:
typecheck:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: stampedeapp/actions/setup@main
- run: yarn tsc
lint:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: stampedeapp/actions/setup@main
- run: yarn lint
cloudformation:
name: Cloudformation Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3.5
- name: "Check file existence"
uses: andstor/file-existence-action@v2
id: check_files
with:
files: "cloudformation/cloudformation.yaml"
- name: CFN Lint
uses: scottbrenner/cfn-lint-action@v2
if: steps.check_files.outputs.files_exists == 'true'
with:
command: cfn-lint -r eu-west-1 -t ./cloudformation/cloudformation.yaml
cloudformation-parameters-validation:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
environment: ["dev", "staging", "prod"]
steps:
- uses: actions/checkout@v3.5
- uses: stampedeapp/actions/cloudformation-validate@main
with:
environment: ${{ matrix.environment }}
jest:
runs-on: ubuntu-latest-4-cores
timeout-minutes: 30
steps:
- uses: stampedeapp/actions/setup@main
with:
ref: ${{ github.event.pull_request.head.sha }}
- run: ${{ inputs.test-setup-command }}
if: ${{ inputs.test-setup-command != '' }}
- run: curl https://deepsource.io/cli | sh
- uses: stampedeapp/actions/jest@main
with:
workers: 2
- if: ${{ always() && env.DEEPSOURCE_DSN != '' }}
run: ./bin/deepsource report --analyzer test-coverage --key javascript --value-file ./coverage/cobertura-coverage.xml