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