forked from usnistgov/pfhub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
55 lines (55 loc) · 2.79 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
---
language: nix
env:
global:
- STORE=$HOME/nix-store
cache:
directories:
- $STORE
before_install:
- sudo mkdir -p /etc/nix
- echo "binary-caches = https://cache.nixos.org/ file://$STORE" | sudo tee -a /etc/nix/nix.conf > /dev/null
- echo 'require-sigs = false' | sudo tee -a /etc/nix/nix.conf > /dev/null
before_cache:
- mkdir -p $STORE
- nix copy --to file://$STORE -f shell.nix buildInputs
- nix copy --to file://$STORE -f _app/shell.nix buildInputs
install:
- nix-shell --pure --command "echo 'run nix-shell and exit'"
- FIRST=`echo ${TRAVIS_COMMIT_RANGE} | sed 's/[.]/\n/g' | head -n 1`
- LAST=`echo ${TRAVIS_COMMIT_RANGE} | sed 's/[.]/\n/g' | tail -n 1`
script:
- if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
nix-shell --pure --command "commitlint --from=${FIRST} --to=${LAST}";
fi
- nix-shell --pure --command "pylint _data/*.py"
- nix-shell --pure --command "flake8 _data/*.py"
- nix-shell --pure --command "LC_ALL=en_US.UTF-8 black --check _data/*.py"
- nix-shell --pure --command "LC_ALL=en_US.UTF-8 make simulations"
- nix-shell --pure --command 'find . -name "*.ipynb" -type f -not -path "*/.ipynb_checkpoints/*" -exec touch {} \;'
- nix-shell --pure --command "make notebooks"
- #nix-shell --pure --command "touch _data/hexbin.yaml"
- #nix-shell --pure --command "make hexbin"
- nix-shell --pure --command "rm -rf ./_site"
# html-proofer might require LC_ALL=en_US.UTF-8 to work on some Nix installations
- nix-shell --command "jekyll build -d ./_site/pfhub && htmlproofer --check-html --only-4xx --allow-hash-href --empty-alt-ignore --checks-to-ignore ImageCheck --file-ignore ./_site/pfhub/node_modules ./_site";
- nix-shell --pure --command "py.test --ignore=hackathons/hackathon1 --ignore=benchmarks --ignore=_data --nbval --sanitize-with sanitize.cfg"
- nix-shell --pure --command "coffeelint _includes/coffee/"
- nix-shell --pure --command "mocha _site/pfhub/js/test.js"
- nix-shell _app/shell.nix --pure --command "cd _app; py.test test.py"
- nix-shell _app/shell.nix --pure --command "cd _app; black --check *.py"
- nix-shell _app/shell.nix --pure --command "cd _app; pylint *.py"
- nix-shell _app/shell.nix --pure --command "cd _app; flake8 *.py"
after_success:
- nix-shell --pure --command "rm -rf ./_site"
- nix-shell --pure --command "make simulations"
- nix-shell --pure --command "make notebooks"
- nix-shell --pure --command "make hexbin"
- nix-shell --pure --command "jekyll build --baseurl ''"
- export DOMAIN=random-cat-${TRAVIS_PULL_REQUEST}.surge.sh
- export SURGE_LOGIN="[email protected]"
- export SURGE_TOKEN="3712d1678fabe65dfad576545befce2f"
- if [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then
nix-shell --command "surge --project _site --domain ${DOMAIN}";
fi
- nix-shell --command "./_code/comment.sh"