2021-08-10 10:42:05 -04:00
|
|
|
name: api.invidious.io CI
|
2021-01-07 07:20:18 -05:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- "master"
|
|
|
|
pull_request:
|
|
|
|
branches: "*"
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Install Crystal
|
2024-04-21 15:36:03 -04:00
|
|
|
uses: crystal-lang/install-crystal@v1.8.1
|
2021-04-27 14:17:32 -04:00
|
|
|
with:
|
2024-04-21 15:36:03 -04:00
|
|
|
crystal: 1.10.1
|
2021-01-07 07:20:18 -05:00
|
|
|
|
|
|
|
- name: Cache Shards
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ./lib
|
|
|
|
key: shards-${{ hashFiles('shard.lock') }}
|
|
|
|
|
|
|
|
- name: Install Shards
|
|
|
|
run: |
|
|
|
|
if ! shards check; then
|
|
|
|
shards install
|
|
|
|
fi
|
|
|
|
|
|
|
|
- name: Run lint
|
|
|
|
run: |
|
|
|
|
if ! crystal tool format --check; then
|
|
|
|
crystal tool format
|
|
|
|
git diff
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: crystal build --warnings all --error-on-warnings --error-trace src/instances.cr
|
|
|
|
|
|
|
|
build-docker:
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Build Docker
|
|
|
|
run: docker-compose up -d
|
|
|
|
|
|
|
|
- name: Test Docker
|
2021-01-07 07:44:15 -05:00
|
|
|
run: curl -Isf http://localhost:3000
|