forked from NimParsers/parsetoml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
65 lines (58 loc) · 1.77 KB
/
.travis.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
language: go # to install the TOML spec tests using "go get"
cache:
directories:
- nim
env:
global:
- PROGNAME="$(basename ${TRAVIS_BUILD_DIR})" # /travis/build/NimParsers/parsetoml -> parsetoml
- NIMFILE="src/${PROGNAME}.nim"
#
- NIMREPO="https://github.com/nim-lang/Nim"
- NIMVER="$(git ls-remote ${NIMREPO} devel | cut -f 1)"
- NIMDIR="${TRAVIS_BUILD_DIR}/nim/${NIMVER}"
install:
- echo "NIMDIR = ${NIMDIR}"
- |
if [[ ! -f "${NIMDIR}/bin/nim" ]]
then
rm -rf nim
mkdir -p nim
git clone --single-branch --branch devel --depth=1 "${NIMREPO}" "${NIMDIR}"
cd "${NIMDIR}" || exit
# Don't build 'koch tools'; remove that line from build_all.sh.
sed -i '/koch tools/d' build_all.sh
sh build_all.sh # https://github.com/nim-lang/Nim/issues/17907#issuecomment-831654235
fi
- |
if [[ ! -f "${NIMDIR}/bin/nimble" ]]
then
cd "${NIMDIR}" || exit
./koch nimble --skipUserCfg --skipParentCfg
fi
- export PATH="${NIMDIR}/bin:${PATH}"
- nim -v
script:
# Ensure that you are in repo/build root now.
- cd "${TRAVIS_BUILD_DIR}"
# Test compilation.
- nim c "${NIMFILE}"
# Test nimble install.
- nimble install --depsOnly --accept
- git clone https://github.com/kaushalmodi/nim_config && cp nim_config/config.nims . # Get global config.nims
- nim test
- nimble run_toml_test
- nim docs
deploy:
provider: pages
# local-dir *has* to be a relative path from the repo root.
local-dir: "public"
skip-cleanup: true
github-token: "${GITHUB_OAUTH_TOKEN}"
keep-history: false
on:
branch: master
notifications:
email:
on_success: never # default: change
on_failure: always # default: always
# Ref: https://github.com/kaushalmodi/hello_musl/blob/master/.travis.yml