invidious/.travis.yml
Leon Klingele 7378a84c96
travis: unshallowly clone Git repo
This fixes a compilation error if too many commits were made after the
most recent tag:

    fatal: No names found, cannot describe anything.
    In src/invidious.cr:60:19
      60 | CURRENT_VERSION = {{ "#{`git describe --tags --abbrev=0`.strip}" }}
    Error: expanding macro

See https://travis-ci.org/leonklingele/invidious/jobs/588672881#L275-L290.
2019-09-25 01:23:12 +02:00

34 lines
996 B
YAML

dist: bionic
jobs:
include:
- stage: build
# TODO: Shallowly clone again once the .git folder is no longer required for building
git:
depth: false
language: crystal
crystal: latest
before_install:
- shards update
- shards install
install:
- crystal build --error-on-warnings src/invidious.cr
script:
- crystal tool format --check
- crystal spec
- stage: build_docker
# TODO: Shallowly clone again once the .git folder is no longer required for building
git:
depth: false
language: minimal
services:
- docker
install:
- docker-compose build
script:
- docker-compose up -d
- sleep 15 # Wait for cluster to become ready, TODO: do not sleep
- HEADERS="$(curl -I -s http://localhost:3000/)"
- STATUS="$(echo $HEADERS | head -n1)"
- if [[ "$STATUS" != *"200 OK"* ]]; then echo "$HEADERS"; exit 1; fi