This repository was archived by the owner on Feb 11, 2022. It is now read-only.
forked from smartcontractkit/chainlink
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontinuous-integration-workflow.yml
More file actions
90 lines (87 loc) · 2.52 KB
/
Copy pathcontinuous-integration-workflow.yml
File metadata and controls
90 lines (87 loc) · 2.52 KB
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
name: CI
on: [push]
jobs:
core:
strategy:
fail-fast: false
matrix:
cmd: ['go_core_tests']
name: Core Tests
runs-on: ubuntu-latest
env:
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/chainlink_test?sslmode=disable
LOG_LEVEL: debug
services:
postgres:
image: postgres:14
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: chainlink_test
POSTGRES_HOST_AUTH_METHOD: trust
# Set health checks to wait until postgres has started
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout the repo
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ^1.17
- name: Cache Go vendor packages
uses: actions/cache@v2
with:
path: /go/pkg/mod
key: go-mod-${{ env.CACHE_VERSION }}-${{ hashFiles('go.sum') }}
restore-keys: |
go-mod-${{ env.CACHE_VERSION }}
- name: Download Go vendor packages
run: go mod download
- name: Setup DB
run: go run ./core local db preparetest
- name: Run tests
run: ./tools/bin/${{ matrix.cmd }}
- name: Store logs artifacts on failure
if: failure()
uses: actions/upload-artifact@v2.3.0
with:
name: ${{ matrix.cmd }}_logs
path: ./output.txt
- name: Print postgres logs
if: always()
uses: docker://docker:latest
with:
args: logs ${{ job.services.postgres.id }}
prepublish_npm:
name: Prepublish NPM
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: "16"
- name: Yarn cache
uses: actions/cache@v2
env:
cache-name: yarn-cache
with:
path: |
~/.npm
~/.cache
**/node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('yarn.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- run: yarn install --frozen-lockfile
- name: Run prepublish NPM test
run: ./tools/ci/prepublish_npm_test