-
Notifications
You must be signed in to change notification settings - Fork 6
130 lines (113 loc) · 3.51 KB
/
ci-cd.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: CI-CD
on:
push:
branches: [master]
workflow_dispatch:
env:
# .yarnrc.yml needs this
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
jobs:
ci:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:12.3-alpine
env:
POSTGRES_PASSWORD: postgres
# health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
dynamodb:
image: amazon/dynamodb-local:latest
ports:
- 8000:8000
steps:
# - name: setup gcloud sdk
# uses: google-github-actions/setup-gcloud@v1
# with:
# version: ">=363.0.0"
# - name: run firestore emulator
# run: gcloud emulators firestore start --host-port=localhost:8080
# env:
# FIRESTORE_EMULATOR_HOST: localhost:8080
# FIRESTORE_PROJECT_ID: test-project-id
# GCLOUD_PROJECT: test-project-id
- uses: actions/checkout@v3
- name: install node 18
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: install and build
run: yarn install && yarn build
- name: unit test
run: yarn test --coverage
env:
PG_HOST: localhost
PG_USER: postgres
PG_PASSWORD: postgres
PG_DATABASE: postgres
AWS_REGION: us-east-1
AWS_DYNAMO_ENDPOINT: http://localhost:8000
AWS_CREDENTIALS_ACCESS_KEY_ID: accesskeyid
AWS_CREDENTIALS_SECRET_ACCESS_KEY: secretaccesskey
- name: coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
cd:
runs-on: ubuntu-latest
needs: ci
strategy:
max-parallel: 1 # to avoid git conflicts
matrix:
lib:
- eventually
- eventually-openapi
- eventually-pg
- eventually-express
- eventually-broker
- eventually-service-expg
- calculator-artifacts
- eventually-aws
- eventually-gcp
- eventually-azure
- eventually-trpc
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: install node 18
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: analyze ${{ matrix.lib }}
id: analyze
uses: rotorsoft/semrel-analyze@v2
with:
package: "@rotorsoft/${{ matrix.lib }}"
directory: "libs/${{ matrix.lib }}"
- name: analysis
run: |
echo "last-tag: ${{ steps.analyze.outputs.last-tag }}"
echo "next-tag: ${{ steps.analyze.outputs.next-tag }}"
echo "next-version: ${{ steps.analyze.outputs.next-version }}"
echo "${{ steps.analyze.outputs.change-log }}"
- name: release ${{ matrix.lib }}
uses: rotorsoft/semrel-release@v1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
npm-registry: "registry.npmjs.org"
npm-token: "${{ secrets.NPM_TOKEN }}"
npm-access: "public"
user: "rotorsoft"
email: "[email protected]"
package: "@rotorsoft/${{ matrix.lib }}"
directory: "libs/${{ matrix.lib }}"
tag: "${{ steps.analyze.outputs.next-tag }}"
version: "${{ steps.analyze.outputs.next-version }}"
change-log: "${{ steps.analyze.outputs.change-log }}"