From 4ba1a4a4dd0449a679a76ac3612108abe49d0a9d Mon Sep 17 00:00:00 2001 From: syeopite Date: Wed, 9 Jun 2021 16:10:58 -0700 Subject: [PATCH] Add CI workflow --- .github/workflows/ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b887655 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 +