sodium.cr/.github/workflows/crystal.yml

58 lines
1.4 KiB
YAML

name: Crystal CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
name: "crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }}"
continue-on-error: ${{ !matrix.stable }}
strategy:
fail-fast: false
matrix:
stable: [true]
crystal:
- 0.36.0
- 0.36.1
- 1.0.0
- 1.1.0
- 1.1.1
- 1.2.0
include:
- crystal: nightly
stable: false
container:
image: crystallang/crystal:${{ matrix.crystal }}
steps:
- uses: actions/checkout@v2
- name: apt update
run: apt update
- name: Install wget
run: apt-get install -y wget
- name: setenv DEBUG
run: echo "SODIUM_BUILD_DEBUG=1" >> $GITHUB_ENV
- name: setenv BUILD_DIR
run: echo "LIBSODIUM_BUILD_DIR=$HOME/libsodium" >> $GITHUB_ENV
- name: Cache libsodium
uses: actions/cache@v2
with:
path: ~/libsodium
key: ${{ runner.os }}-libsodium-${{ hashFiles('build/env.sh') }}
- name: Install dependencies
run: shards install
- name: Run tests
run: crystal spec -Dpreview_mt --order random
- name: Run bulid
run: shards build -Dpreview_mt
- name: Run format
run: crystal tool format --check
- name: Failed
if: ${{ failure() }}
run: "[ -f libsodium_install.out ] && cat libsodium_install.out"