From f5a407f8624137437ba42fc14841cef1b7d687fa Mon Sep 17 00:00:00 2001 From: syeopite Date: Sat, 23 Aug 2025 04:31:50 -0700 Subject: [PATCH] Add CI to test on different crystal versions --- .github/workflows/ci.yml | 69 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 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..39bb475 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,69 @@ +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: 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