Merge pull request #11 from syeopite/add-ci

Add CI workflow
This commit is contained in:
syeopite 2021-06-10 04:38:21 -07:00 committed by GitHub
commit cdec31a66e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 48 additions and 0 deletions

48
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,48 @@
name: lsquic.cr CI
on:
push:
branches:
- "master"
pull_request:
branches: "*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Crystal
uses: oprypin/install-crystal@v1.2.4
with:
crystal: 1.0.0
- 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 tests
run: crystal spec
- 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/lsquic.cr