-
Notifications
You must be signed in to change notification settings - Fork 1
93 lines (78 loc) · 2.27 KB
/
Copy pathtest.yml
File metadata and controls
93 lines (78 loc) · 2.27 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
91
92
93
name: Unit tests
on:
pull_request:
paths:
- '.github/workflows/test.yml'
- 'docker-compose.yml'
- 'async_postgres.nim*'
- 'async_postgres/**'
- 'tests/**'
- 'examples/**'
push:
paths:
- '.github/workflows/test.yml'
- 'docker-compose.yml'
- 'async_postgres.nim*'
- 'async_postgres/**'
- 'tests/**'
- 'examples/**'
branches:
- main
permissions:
contents: read
jobs:
tests:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
os:
- 'ubuntu-latest'
- 'macOS-latest'
nim-version:
- '2.2.4'
- 'stable'
- 'devel'
name: Tests on ${{ matrix.nim-version }} (${{ matrix.os }})
steps:
- uses: actions/checkout@v6
- name: Cache nimble
id: cache-nimble
uses: actions/cache@v5
with:
path: ~/.nimble
key: ${{ runner.os }}-nimble-v2-${{ hashFiles('*.nimble') }}
restore-keys: |
${{ runner.os }}-nimble-v2-
- name: Setup Nim (stable/release)
uses: jiro4989/setup-nim-action@v2
with:
nim-version: ${{ matrix.nim-version }}
repo-token: ${{ secrets.GITHUB_TOKEN }}
if: matrix.nim-version != 'devel'
- name: Setup Nim (devel)
uses: jiro4989/setup-nim-action@v2
with:
nim-version: ${{ matrix.nim-version }}
use-nightlies: true
repo-token: ${{ secrets.GITHUB_TOKEN }}
if: matrix.nim-version == 'devel'
- name: Generate test certificates
run: bash tests/gen_certs.sh
- name: Start PostgreSQL
run: docker compose up -d --wait
- name: Install chronos
run: nimble install chronos -y
- name: Run tests
run: nimble test -y
- name: Install async_postgres
run: |
rm -rf ~/.nimble/pkgs2/async_postgres-*
nimble install -y
- name: Compile examples (asyncdispatch)
run: for f in examples/*.nim; do nim c "$f"; done
- name: Compile examples (chronos)
run: for f in examples/*.nim; do nim c -d:asyncBackend=chronos "$f"; done
- name: Gen docs
run: |
nim doc --project --index:on --outdir:./htmldocs ./async_postgres.nim