-
Notifications
You must be signed in to change notification settings - Fork 63
155 lines (133 loc) · 4.24 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: CI
on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
branches:
- main
paths-ignore:
- '**.md'
workflow_dispatch:
jobs:
connector-acceptance-test:
if: ${{ github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' }} # Skip PRs
name: Connector Acceptance Test
runs-on: ubuntu-latest
timeout-minutes: 45
env:
FORCE_COLOR: true
steps:
- name: Check out
uses: actions/checkout@v4
- name: Run Jenkins server
run: |
mkdir -p ${{ github.workspace }}/sources/jenkins-source/test_files/jenkins/data/secrets/
docker run -d -u 0 -i --name jenkins -p 8080:8080 -p 50000:50000 -v ${{ github.workspace }}/sources/jenkins-source/test_files/jenkins/data:/var/jenkins_home jenkins/jenkins:lts-jdk11
echo "Waiting until Jenkins is up"
waiting=0
until curl -s -I -X GET http://127.0.0.1:8080; do
docker ps -a
let waiting+=3
sleep 3
if [ $waiting -eq 120 ]; then
echo "Jenkins server did not respond within 120 seconds"
exit 42
fi
done
sudo chown -R $USER:$USER ${{ github.workspace }}/sources/jenkins-source/test_files/jenkins/data
- name: Source Acceptance Test
run: ./scripts/source-acceptance-test.sh example-source
- name: Stop Jenkins server
if: ${{ github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' }} # Skip PRs
run: |
docker stop jenkins
docker rm jenkins
test:
name: Test
runs-on: ubuntu-latest
timeout-minutes: 30
env:
FORCE_COLOR: true
HUSKY_SKIP_INSTALL: 1
HUSKY_SKIP_HOOKS: 1
HUSKY: 0
steps:
- name: Check out
uses: actions/checkout@v4
- name: Cache Node modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Cache Turbo build setup
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 18.x
- name: Install Turborepo
run: npm install turbo --global
- name: Install dependencies
run: npm ci --prefer-offline --no-audit --no-fund
- name: Test
env:
NODE_OPTIONS: '--max-old-space-size=4096'
run: turbo test-cov
test-packaging:
if: ${{ github.ref != 'refs/heads/main' && github.event_name != 'workflow_dispatch' }} # Only on PRs
name: Packaging Test
runs-on: ubuntu-latest
timeout-minutes: 15
env:
FORCE_COLOR: true
HUSKY_SKIP_INSTALL: 1
HUSKY_SKIP_HOOKS: 1
HUSKY: 0
steps:
- name: Check out
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18.x
registry-url: https://registry.npmjs.org
- name: Cache Turbo build setup
uses: actions/cache@v4
with:
path: .turbo
key: ${{ runner.os }}-turbo-${{ github.sha }}
restore-keys: |
${{ runner.os }}-turbo-
- name: Install Turborepo
run: npm install turbo --global
- name: Install dependencies
run: npm ci --prefer-offline --no-audit --no-fund
- name: Build packages
run: turbo build
- name: Test Airbyte CDK package
run: |
cd faros-airbyte-cdk && \
npm publish --dry-run
- name: Test Airbyte Common package
run: |
cd faros-airbyte-common && \
npm publish --dry-run
- name: Test Faros Destination package
run: |
cd destinations/airbyte-faros-destination && \
npm publish --dry-run