Add CI workflow
This commit is contained in:
parent
3aab3dd7f1
commit
4ba1a4a4dd
|
@ -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
|
||||
|
Loading…
Reference in New Issue