CI #773
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
workflow_dispatch: {} | |
push: | |
branches: ["**"] | |
schedule: | |
- cron: 0 23 * * * | |
jobs: | |
quality: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Crystal Ameba Linter | |
run: docker run -t -v $PWD/src:/src veelenga/ameba:v0.14.1 | |
- name: Hadolint Action | |
uses: brpaz/hadolint-action@v1.1.0 | |
docker: | |
runs-on: ubuntu-latest | |
needs: | |
- quality | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Setup Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Build Docker image | |
uses: docker/build-push-action@v2 | |
with: | |
push: false | |
platforms: linux/amd64 | |
cache-from: type=registry,ref=boord/werk:latest | |
cache-to: type=inline | |
test: | |
runs-on: "${{ matrix.os }}" | |
strategy: | |
matrix: | |
os: ["macos-latest", "ubuntu-latest"] | |
needs: | |
- quality | |
steps: | |
- name: Install Crystal | |
uses: oprypin/install-crystal@v1 | |
with: | |
crystal: 1.3.2 | |
- name: Additional Linux dependencies | |
if: contains(matrix.os, 'ubuntu') | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libyaml-dev | |
- name: Additional macOS dependencies | |
if: contains(matrix.os, 'macos') | |
run: | | |
brew install openssl | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: shards install --ignore-crystal-version | |
- name: Run tests | |
run: crystal spec |