mirror of
https://github.com/iv-org/protodec.git
synced 2026-01-01 08:00:18 -05:00
The formatter job does not build protodec and as such does not require the presence of tags
72 lines
1.5 KiB
YAML
72 lines
1.5 KiB
YAML
name: Protodec CI
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "0 0 * * *" # Every day at 00:00
|
|
push:
|
|
branches:
|
|
- "master"
|
|
pull_request:
|
|
branches: "*"
|
|
paths-ignore:
|
|
- "*.md"
|
|
- LICENCE
|
|
- .editorconfig
|
|
|
|
jobs:
|
|
build-test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: "build and test - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }}"
|
|
|
|
continue-on-error: ${{ !matrix.stable }}
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
stable: [true]
|
|
crystal:
|
|
- 1.0.0
|
|
- 1.16.3
|
|
- 1.17.1
|
|
include:
|
|
- crystal: nightly
|
|
stable: false
|
|
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
|
|
- name: "Fetch tags (required to build Protodec)"
|
|
run: git fetch --depth=1 origin '+refs/tags/*:refs/tags/*'
|
|
|
|
- name: Install Crystal
|
|
uses: crystal-lang/install-crystal@v1.8.2
|
|
with:
|
|
crystal: ${{ matrix.crystal }}
|
|
|
|
- name: Run tests
|
|
run: crystal spec --error-trace
|
|
|
|
- name: Build
|
|
run: crystal build --warnings all --error-on-warnings --error-trace src/protodec.cr
|
|
|
|
formatter:
|
|
runs-on: ubuntu-latest
|
|
continue-on-error: true
|
|
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
|
|
- name: Install Crystal
|
|
uses: crystal-lang/install-crystal@v1.8.2
|
|
with:
|
|
crystal: latest
|
|
|
|
- name: Check Crystal formatter compliance
|
|
run: |
|
|
if ! crystal tool format --check; then
|
|
crystal tool format
|
|
git diff
|
|
exit 1
|
|
fi
|