This repository has been archived by the owner on Apr 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 73
118 lines (112 loc) · 2.96 KB
/
graphback-ci.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
name: GraphbackCI
on:
push:
branches:
- master
paths-ignore:
- '*.md'
- 'docs/**'
- '.gitignore'
- 'website/**'
- '.vscode/**'
- 'templates/**'
- '.github/*.yml'
- 'performance/**'
- 'packages/**/*md'
- '.github/ISSUE_TEMPLATE/**'
- '.github/workflows/build-website.yml'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- master
paths-ignore:
- '*.md'
- 'docs/**'
- '.vscode/**'
- 'website/**'
- '.gitignore'
- 'templates/**'
- '.github/*.yml'
- 'performance/**'
- 'packages/**/*md'
- '.github/ISSUE_TEMPLATE/**'
- '.github/workflows/build-website.yml'
release:
types: [released, prereleased]
env:
NODE_OPTIONS: --max_old_space_size=4096
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 60
services:
mongodb:
image: mongo:4.2.9
env:
MONGO_INITDB_DATABASE: users
MONGO_INITDB_ROOT_USERNAME: mongodb
MONGO_INITDB_ROOT_PASSWORD: mongo
ports:
- 27017:27017
postgres:
image: postgres:12
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgresql
POSTGRES_DB: users
ports:
- 5432:5432
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout master
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Cache Dependencies
id: cache-dependencies
uses: actions/cache@master
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}
- name: Install dependencies
if: steps.cache-dependencies.outputs.cache-hit != 'true'
run: yarn
- name: Build
run: yarn build
- name: Lint
run: yarn lint
- name: Unit Test
run: yarn test
- name: Integration Test
run: yarn test:integration
publishPackages:
# publish to npm only when doing the release
if: ${{ github.event_name == 'release' }}
env:
CI: true
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout master
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Cache Dependencies
id: cache-dependencies
uses: actions/cache@master
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/package.json') }}
- name: Build
run: yarn build
- name: Publish
run: echo "//registry.npmjs.org/:_authToken=${{secrets.NPM_AUTH_TOKEN}}" > ~/.npmrc && TAG=${GITHUB_REF#"refs/tags/"} npm run release:publish