-
Notifications
You must be signed in to change notification settings - Fork 3
120 lines (101 loc) · 3.16 KB
/
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
119
120
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
# ******** NOTE ********
name: "CI"
on:
push:
branches: [main]
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
jobs:
test:
# Cannot rely on Github Azure hosted action because of GCP connection
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: ["16", "18"]
name: Build with NodeJS v${{ matrix.node }}
env:
FORCE_COLOR: 1
services:
localstack:
image: localstack/localstack:latest
ports:
- 4566:4566
env:
SERVICES: s3,sts,sqs,dynamodb,secretsmanager,logs
mongodb:
image: mongo
ports:
- 37017:27017
env:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: webda.io
amqp:
image: rabbitmq
ports:
- 5672:5672
permissions:
id-token: "write"
steps:
- name: Checkout repository
uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- name: Configure sysctl limits
run: |
sudo swapoff -a
sudo sysctl -w vm.swappiness=1
sudo sysctl -w fs.file-max=262144
sudo sysctl -w vm.max_map_count=262144
- name: Runs Elasticsearch
uses: elastic/elastic-github-actions/elasticsearch@master
with:
stack-version: 8.2.0
security-enabled: false
- name: Setup postgresql
uses: Softwarepark/postgresql-action@v2
with:
postgresql version: "15" # See https://hub.docker.com/_/postgres for available versions
postgresql password: webda.io
postgresql user: webda.io
postgresql db: webda.io
postgresql init scripts: packages/postgres/test/sql
- id: auth
uses: google-github-actions/[email protected]
with:
create_credentials_file: true
workload_identity_provider: ${{ secrets.GCP_OIDC_ID_PROVIDER }}
service_account: ${{ secrets.GCP_OIDC_SA}}
- name: Restore Lerna/NX Cache
uses: actions/cache@v3
with:
path: node_modules/.cache
key: ${{ runner.os }}-${{ matrix.node }}
- name: Install dependencies
run: yarn
- name: Build
run: yarn run build
- name: Run tests
run: yarn run test --exclude @webda/shell
env:
NODE_OPTIONS: "--max-old-space-size=6144"
- name: Run shell tests
run: yarn nx run @webda/shell:test
env:
NODE_OPTIONS: "--max-old-space-size=6144"
- name: CodeCov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}