Skip lib directory after shards install #235
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: Run test and verifier | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
test: | |
strategy: | |
matrix: | |
version: | |
- '1.9.1' | |
runs-on: ubuntu-latest | |
container: | |
image: crystallang/crystal:${{ matrix.version }} | |
# https://github.com/SimonKagstrom/kcov/issues/151#issuecomment-249284631 | |
options: --security-opt seccomp=unconfined | |
steps: | |
- name: Install latest git | |
run: | | |
apt-get update | |
apt-get install software-properties-common -y | |
apt-add-repository ppa:git-core/ppa -y | |
apt-get install git -y | |
- uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: | | |
apt-get install python3 libpython3.8 python3-dev python3-pip bash libxml2-dev libxslt-dev build-essential binutils-dev libcurl4-openssl-dev zlib1g-dev libdw-dev libiberty-dev cmake curl wget -y | |
- name: Install kcov | |
run: | | |
cd /tmp | |
git clone --depth 1 -b v38 https://github.com/SimonKagstrom/kcov.git | |
mkdir -p kcov/build | |
cd kcov/build | |
cmake .. | |
make -j8 | |
make install | |
- name: Run tests | |
run: crystal spec --verbose | |
- name: Run Benchmarks | |
run: crystal run --release benchmarks/* | |
- name: Run coverage | |
if: ${{ matrix.version == '1.9.1' }} | |
run: | | |
shards build test --ignore-crystal-version | |
kcov --clean --include-path=src coverage ./bin/test | |
bash <(curl -s https://codecov.io/bash) -s coverage | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
shell: bash | |
lint: | |
runs-on: ubuntu-latest | |
container: | |
image: crystallang/crystal:1.9.1 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Crystal dependencies | |
run: | | |
shards install | |
# We only need bin directory. lib contains recursive symlink and troublesome. | |
rm -rf lib | |
- name: Run linter | |
run: bin/ameba | |
verify: | |
strategy: | |
matrix: | |
version: | |
- '1.9.1' | |
runs-on: ubuntu-latest | |
container: | |
image: crystallang/crystal:${{ matrix.version }} | |
steps: | |
- name: Install latest git | |
run: | | |
apt-get update | |
apt-get install software-properties-common -y | |
apt-add-repository ppa:git-core/ppa -y | |
apt-get install git -y | |
git config --global --add safe.directory /__w/ac-library.cr/ac-library.cr | |
- uses: actions/checkout@v3 | |
- name: Cache .verify-helper | |
uses: actions/cache@v2 | |
with: | |
path: | | |
.verify-helper/cache | |
.verify-helper/timestamps.local.json | |
key: ${{ runner.os }}-crystal-${{ matrix.version }}-verify-helper | |
- name: Install dependencies | |
run: | | |
apt-get install python3 libpython3.8 python3-dev python3-pip bash libxml2-dev libxslt-dev build-essential binutils-dev libcurl4-openssl-dev zlib1g-dev libdw-dev libiberty-dev libyaml-dev libgdbm-dev libreadline-dev libncurses5-dev cmake curl wget time -y | |
- name: Install Crystal dependencies | |
run: | | |
shards install | |
# We only need bin directory. lib contains recursive symlink and troublesome. | |
rm -rf lib | |
- name: Install pip dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install -r requirements.txt | |
- name: Run verifier | |
run: oj-verify run --jobs 4 | |
deploy: | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
container: | |
image: crystallang/crystal:1.9.1 | |
needs: | |
- test | |
- lint | |
- verify | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Crystal dependencies | |
run: | | |
shards install | |
# We only need bin directory. lib contains recursive symlink and troublesome. | |
rm -rf lib | |
- name: Install dependencies | |
run: | | |
apt-get update | |
apt-get install python3 libpython3.8 python3-dev python3-pip bash libxml2-dev libxslt-dev build-essential binutils-dev libcurl4-openssl-dev zlib1g-dev libdw-dev libiberty-dev libyaml-dev libgdbm-dev libreadline-dev libncurses5-dev cmake curl wget time -y | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '2.6' | |
- name: Install pip dependencies | |
run: | | |
python3 -m pip install --upgrade pip | |
python3 -m pip install -r requirements.txt | |
- name: Generate bundled docs | |
run: oj-verify docs --jobs 4 | |
- name: Generate API docs | |
run: crystal docs --progress --stats --time -o dist/api | |
- name: Build bundled docs | |
run: | | |
gem install bundler | |
bundle install --gemfile=.verify-helper/markdown/Gemfile --path .vendor/bundle | |
bundle exec --gemfile=.verify-helper/markdown/Gemfile jekyll build --source .verify-helper/markdown --destination dist/docs --baseurl ac-library.cr/docs | |
- name: Deploy docs to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./dist |