-
Notifications
You must be signed in to change notification settings - Fork 51
221 lines (218 loc) · 7.07 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
name: CI
# Run on master, tags, or any pull request
on:
schedule:
- cron: '0 2 * * *' # Daily at 2 AM UTC (8 PM CST)
push:
branches: [master]
tags: ["*"]
pull_request:
env:
PGDATABASE: postgres
PGUSER: postgres
PGPASSWORD: root
jobs:
test:
name: Julia ${{ matrix.version }} - PostgreSQL ${{ matrix.postgresql-version }} - ${{ matrix.os }} - ${{ matrix.arch }} - nonblocking connection(${{ matrix.nonblocking }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- "1" # Latest Release
postgresql-version:
- latest
os:
- ubuntu-latest
- macOS-latest
- windows-latest
arch:
- x64
- x86
nonblocking:
- "false"
exclude:
# Don't test 32-bit on macOS
- os: macOS-latest
arch: x86
include:
# Add a LTS job just to make sure we still support it
- os: ubuntu-latest
version: "1.6"
arch: x64
postgresql-version: latest
nonblocking: "false"
# Add older supported PostgreSQL Versions
- os: ubuntu-latest
version: 1
arch: x64
postgresql-version: '13'
nonblocking: "false"
- os: ubuntu-latest
version: 1
arch: x64
postgresql-version: '12'
nonblocking: "false"
- os: ubuntu-latest
version: 1
arch: x64
postgresql-version: '11'
nonblocking: "false"
- os: ubuntu-latest
version: 1
arch: x64
postgresql-version: '10'
nonblocking: "false"
- os: ubuntu-latest
version: 1
arch: x64
postgresql-version: latest
nonblocking: "true"
- os: ubuntu-latest
version: "1.6"
arch: x64
postgresql-version: latest
nonblocking: "true"
- os: windows-latest
version: 1
arch: x64
postgresql-version: latest
nonblocking: "true"
- os: macOS-latest
version: 1
arch: x64
postgresql-version: latest
nonblocking: "true"
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v2
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-${{ matrix.arch }}-test-${{ env.cache-name }}-nonblocking-${{ matrix.nonblocking }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-${{ matrix.arch }}-test-${{ env.cache-name }}-
${{ runner.os }}-${{ matrix.arch }}-test-
${{ runner.os }}-${{ matrix.arch }}-
${{ runner.os }}-
# Linux
- name: Install PostgreSQL
uses: harmon758/postgresql-action@v1
if: ${{ runner.os == 'Linux' }}
with:
postgresql version: ${{ matrix.postgresql-version }}
postgresql user: ${{ env.PGUSER }}
postgresql password: ${{ env.PGPASSWORD }}
- name: Wait / Sleep
uses: jakejarvis/[email protected]
if: ${{ runner.os == 'Linux' }}
with:
time: '1m'
- name: Collect Docker Logs
uses: jwalton/[email protected]
if: ${{ runner.os == 'Linux' }}
- name: Check running containers
run: docker ps -a
if: ${{ runner.os == 'Linux' }}
- name: Set PGHOST on Linux
run: echo "PGHOST=localhost" >> $GITHUB_ENV
if: ${{ runner.os == 'Linux' }}
# MacOS
- name: Set PGUSER on macOS
run: |
echo "PGUSER=$USER" >> $GITHUB_ENV
echo "LIBPQJL_DATABASE_USER=$USER" >> $GITHUB_ENV
if: ${{ runner.os == 'macOS' }}
- name: Start Homebrew PostgreSQL service
run: pg_ctl -D /usr/local/var/postgresql@$(psql --version | cut -f3 -d' ' | cut -f1 -d.) start
if: ${{ runner.os == 'macOS' }}
# Windows
- name: Add PostgreSQL to Path
run: |
echo $env:PGBIN
echo $env:PGBIN | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
if: ${{ runner.os == 'Windows' }}
- name: Start Windows PostgreSQL service
run: |
pg_ctl -D $env:PGDATA start
pg_ctl -D $env:PGDATA status
if: ${{ runner.os == 'Windows' }}
# Run Tests
- run: echo "LIBPQJL_CONNECTION_NONBLOCKING=${{ matrix.nonblocking }}" >> $GITHUB_ENV
- run: psql -c '\conninfo'
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
file: lcov.info
slack:
name: Notify Slack Failure
needs: test
runs-on: ubuntu-latest
if: always() && github.event_name == 'schedule'
steps:
- uses: technote-space/workflow-conclusion-action@v2
- uses: voxmedia/github-action-slack-notify-build@v1
if: env.WORKFLOW_CONCLUSION == 'failure'
with:
channel: nightly-dev
status: FAILED
color: danger
env:
SLACK_BOT_TOKEN: ${{ secrets.DEV_SLACK_BOT_TOKEN }}
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: '1'
- name: Setup documentation dependencies
run: |
sudo apt-get update -y -qq
sudo apt-get install -y -qq fonts-lmodern pdf2svg texlive-latex-extra texlive-luatex texlive-pictures texlive-xetex
- uses: harmon758/postgresql-action@v1
with:
postgresql version: latest
postgresql user: ${{ env.PGUSER }}
postgresql password: ${{ env.PGPASSWORD }}
- name: Wait / Sleep
uses: jakejarvis/[email protected]
with:
time: '1m'
- name: Collect Docker Logs
uses: jwalton/[email protected]
- name: Check running containers
run: docker ps -a
- name: Set PGHOST
run: echo "PGHOST=localhost" >> $GITHUB_ENV
- run: |
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()
include("docs/make.jl")'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
error-codes:
name: Error Codes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: '1'
- name: Install Julia packages
run: julia -e 'using Pkg; Pkg.add(["EzXML", "HTTP"]);'
- name: Generate error codes
run: julia deps/error_codes.jl error_codes_generated.jl
- name: Compare error codes
run: diff error_codes_generated.jl src/error_codes.jl