.github/workflows/ci.yml #42
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
on: | |
push: | |
branches: | |
- master | |
tags: | |
- "v*.*.*" | |
schedule: | |
- cron: "15 3 * * 1" # Every monday at 3:15 AM | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cache shards | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/shards | |
key: ${{ runner.os }}-shards-${{ hashFiles('shard.yml') }} | |
restore-keys: ${{ runner.os }}-shards- | |
- name: Download source | |
uses: actions/checkout@v2 | |
- name: Install Crystal | |
uses: crystal-lang/install-crystal@v1 | |
- name: Install shards | |
run: shards check || shards install --without-development | |
- name: Check formatting | |
run: crystal tool format --check | |
- name: Run Ameba | |
run: bin/ameba --except Metrics/CyclomaticComplexity | |
- name: Run tests | |
run: crystal spec --order=random --error-on-warnings | |
- name: Build docs | |
run: crystal docs | |
- name: Deploy docs | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs |