Merge pull request #33 from davidmatter/patch-1 #238
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: Linux CI | |
on: | |
push: | |
pull_request: | |
branches: [master] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download source | |
uses: actions/checkout@v2 | |
- name: Install packages | |
run: sudo apt-get -qy install libunibilium4 libunibilium-dev libreadline-dev libpcre3-dev libevent-dev libgc-dev libyaml-dev libxml2-dev | |
- name: Install Crystal | |
uses: oprypin/install-crystal@v1 | |
- name: Cache shards | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/shards | |
key: ${{ runner.os }}-shards-${{ hashFiles('shard.yml') }} | |
restore-keys: ${{ runner.os }}-shards- | |
- name: Install shards | |
run: shards update --ignore-crystal-version | |
- name: Run tests | |
run: crystal spec --order=random --error-on-warnings | |
- name: Build example | |
run: crystal build examples/tech-demo.cr | |
- name: Check formatting | |
run: crystal tool format --check | |
release_linux: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download source | |
uses: actions/checkout@v2 | |
- name: Install packages | |
run: sudo apt-get -qy install libunibilium4 libunibilium-dev libreadline-dev libpcre3-dev libevent-dev libgc-dev libyaml-dev libxml2-dev | |
- name: Install Crystal | |
uses: oprypin/install-crystal@v1 | |
- name: Cache shards | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/shards | |
key: ${{ runner.os }}-shards-${{ hashFiles('shard.yml') }} | |
restore-keys: ${{ runner.os }}-shards- | |
- name: Install shards | |
run: shards update --production --release --static --no-debug --ignore-crystal-version | |
- name: Build binaries | |
run: | | |
crystal build --time --release --static --no-debug -o bin/tech-demo examples/tech-demo.cr | |
crystal build --time --release --static --no-debug -o bin/hello examples/hello.cr | |
crystal build --time --release --static --no-debug -o bin/hello2 examples/hello2.cr | |
crystal build --time --release --static --no-debug -o bin/chat examples/chat.cr | |
crystal build --time --release --static --no-debug -o bin/shadow small-tests/shadow.cr |