-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (99 loc) · 4.34 KB
/
feature.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
name: Unit & Integration Tests
on:
push:
branches:
- feature/**
- GAP-**
- bug/**
paths-ignore:
- '*.md'
pull_request:
types: [closed]
branches:
- feature/**
- GAP-**
paths-ignore:
- '*.md'
env:
DATABASE_URL: postgres://postgres:mysecretpassword@localhost:5432/notifications
jobs:
Build:
name: Build Application
runs-on: ubuntu-latest
permissions:
contents: read
steps:
# ==============================
- name: Dump context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "${GITHUB_CONTEXT}"
# ==============================
- name: Checkout repo
uses: actions/checkout@master
- name: Generate .env
run: |
cat << EOF > .env
CONTENTFUL_SPACE_ID=${{ secrets.DEV_CONTENTFUL_SPACE_ID }}
CONTENTFUL_ACCESS_TOKEN=${{ secrets.DEV_CONTENTFUL_ACCESS_TOKEN }}
CONTENTFUL_PREVIEW_ACCESS_TOKEN=${{ secrets.DEV_CONTENTFUL_PREVIEW_ACCESS_TOKEN }}
CONTENTFUL_MANAGEMENT_TOKEN=${{ secrets.DEV_CONTENTFUL_MANAGEMENT_TOKEN }}
CONTENTFUL_ENVIRONMENT=${{ secrets.DEV_CONTENTFUL_ENVIRONMENT }}
ELASTIC_INDEX=${{ secrets.DEV_ELASTIC_INDEX }}
ELASTIC_URL=${{ secrets.DEV_ELASTIC_URL }}
ELASTIC_USERNAME=${{ secrets.DEV_ELASTIC_USERNAME }}
ELASTIC_PASSWORD=${{ secrets.DEV_ELASTIC_PASSWORD }}
GOV_NOTIFY_API_KEY=${{ secrets.GOV_NOTIFY_API_KEY }}
GOV_NOTIFY_GRANT_UPDATED_EMAIL_TEMPLATE_ID=${{ secrets.GOV_NOTIFY_GRANT_UPDATED_EMAIL_TEMPLATE_ID }}
GOV_NOTIFY_GRANT_CLOSING_EMAIL_TEMPLATE_ID=${{ secrets.GOV_NOTIFY_GRANT_CLOSING_EMAIL_TEMPLATE_ID }}
GOV_NOTIFY_GRANT_OPENING_EMAIL_TEMPLATE_ID=${{ secrets.GOV_NOTIFY_GRANT_OPENING_EMAIL_TEMPLATE_ID }}
GOV_NOTIFY_SAVED_SEARCH_NOTIFICATION_EMAIL_TEMPLATE_ID=${{ secrets.GOV_NOTIFY_SAVED_SEARCH_NOTIFICATION_EMAIL_TEMPLATE_ID }}
DATABASE_SSL=true
HOST=${{ secrets.DEV_ENVIRONMENT_URL }}
ENCRYPTION_KEY_NAME=${{ secrets.DEV_ENCRYPTION_KEY_NAME }}
ENCRYPTION_KEY_NAMESPACE=${{ secrets.DEV_ENCRYPTION_KEY_NAMESPACE }}
ENCRYPTION_ORIGIN=${{ secrets.DEV_ENCRYPTION_ORIGIN }}
ENCRYPTION_STAGE=${{ secrets.DEV_ENCRYPTION_STAGE }}
ENCRYPTION_WRAPPING_KEY=${{ secrets.DEV_ENCRYPTION_WRAPPING_KEY }}
FRONT_END_HOST=${{ secrets.DEV_FRONTEND_URL }}
YARN_IGNORE_NODE=1
EOF
- name: Read .nvmrc
run: echo "::set-output name=NVMRC::$(cat .nvmrc)"
id: nvm
- name: Setup node
uses: actions/setup-node@master
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
- name: Snyk setup
uses: snyk/actions/node@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --yarn-workspaces --strict-out-of-sync=false
- name: Install yarn
run: npm install -g yarn && yarn set version berry
- name: Read yarn cache directory path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
id: yarn-cache-dir-path
- name: Cache dependencies
uses: actions/cache@v2
id: yarn-cache
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
**/node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: |
yarn install --immutable
- name: Units Tests
run: |
yarn test:cov
- name: Build application
run: |
yarn build
# =============================