-
Notifications
You must be signed in to change notification settings - Fork 5
92 lines (82 loc) · 3.24 KB
/
main.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
name: test
on:
push:
pull_request:
jobs:
skip:
runs-on: ubuntu-latest
steps:
- run: echo "Skip job"
before:
runs-on: ubuntu-latest
if: '! contains(github.event.head_commit.message, "[skip ci]")'
steps:
- run: echo "not contains '[skip ci]'"
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
#- windows-latest
#- macOS-latest
nim-version:
- '1.4.0'
- '1.6.14' # stable is already v2 but this hasn't supported that yet
# - 'stable'
needs: before
steps:
- uses: actions/checkout@v1
- name: Cache nimble
id: cache-nimble
uses: actions/cache@v1
with:
path: ~/.nimble
key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }}
- uses: jiro4989/setup-nim-action@v1
with:
nim-version: ${{ matrix.nim-version }}
# see. https://github.com/actions/virtual-environments/issues/675
- name: Fix apt packages
run: |
sudo sed -i 's/azure\.//' /etc/apt/sources.list
sudo apt update -yqq
# https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/
- name: Install mongodb
run: |
sudo apt-get install gnupg
curl -fsSL https://pgp.mongodb.com/server-6.0.asc | \
sudo gpg -o /usr/share/keyrings/mongodb-server-6.0.gpg \
--dearmor
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
sudo apt-get update -yqq
sudo apt-get install -y mongodb-org
# - name: Start mongodb
# run: |
# sudo systemctl start mongod
# sleep 10
- run: nimble install -Y
# Disabling running mongod since mongod is already running with systemctl
# Disabling test gridfs because no big file available, by setting filename and saveas to blank
# Disabling authenticating since the installed mongo is pristine without setting up the user and password
- name: Nimble test setup and run
run: |
# echo 'switch("define", "nomongod")' > config.nims
mkdir /tmp/mongodbpath
echo 'switch("define", "filename=")' > config.nims
echo 'switch("define", "filename=")' >> config.nims
echo 'switch("define", "saveas=")' >> config.nims
echo 'switch("define", "user=")' >> config.nims
echo 'switch("define", "testReplication=yes")' >> config.nims
echo 'switch("define", "testChangeStreams=yes")' >> config.nims
echo 'hint("ConvFromXToItSelfNotNeeded", off)' >> config.nims
echo 'switch("define", "dbpath=/tmp/mongodbpath")' >> config.nims
echo 'switch("define", "uri")' >> config.nims
nimble test -Y
- uses: actions/checkout@v2.3.1
- run: nim doc --project --index:on --git.url:https://github.com/mashingan/anonimongo --outdir:src/htmldocs src/anonimongo.nim
- name: Deploy docs
uses: JamesIves/github-pages-deploy-action@v4.4.1
with:
branch: gh-pages
folder: .