Skip to content

Commit

Permalink
Merge pull request #21 from ngng628/gh-actions-update
Browse files Browse the repository at this point in the history
Support for Crystal version 1.9.1
  • Loading branch information
hakatashi committed Sep 4, 2023
2 parents 201dd34 + 32d1680 commit 29255df
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 24 deletions.
35 changes: 18 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
matrix:
version:
- '0.33.0'
- '1.7.2'
- '1.9.1'
runs-on: ubuntu-latest
container:
image: crystallang/crystal:${{ matrix.version }}
Expand All @@ -25,7 +25,7 @@ jobs:
apt-get install software-properties-common -y
apt-add-repository ppa:git-core/ppa -y
apt-get install git -y
- uses: actions/checkout@v2
- 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
Expand All @@ -43,7 +43,7 @@ jobs:
- name: Run Benchmarks
run: crystal run --release benchmarks/*
- name: Run coverage
if: ${{ matrix.version == '1.7.2' }}
if: ${{ matrix.version == '1.9.1' }}
run: |
shards build test --ignore-crystal-version
kcov --clean --include-path=src coverage ./bin/test
Expand All @@ -55,9 +55,9 @@ jobs:
lint:
runs-on: ubuntu-latest
container:
image: crystallang/crystal:1.7.2
image: crystallang/crystal:1.9.1
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Crystal dependencies
run: |
shards install --ignore-crystal-version
Expand All @@ -69,7 +69,7 @@ jobs:
matrix:
version:
- '0.33.0'
- '1.7.2'
- '1.9.1'
runs-on: ubuntu-latest
container:
image: crystallang/crystal:${{ matrix.version }}
Expand All @@ -81,12 +81,7 @@ jobs:
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@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: '2.6'
env:
ImageOS: ubuntu18
- uses: actions/checkout@v3
- name: Cache .verify-helper
uses: actions/cache@v2
with:
Expand All @@ -96,28 +91,34 @@ jobs:
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 cmake curl wget time -y
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 rbenv -y
- name: Install Ruby-2.6.10
run: |
git clone https://github.com/rbenv/ruby-build.git
./ruby-build/install.sh
rbenv install 2.6.10
rbenv global 2.6.10
- 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
- name: Generate bundled docs
if: ${{ github.event_name == 'push' && matrix.version == '1.7.2' }}
if: ${{ github.event_name == 'push' && matrix.version == '1.9.1' }}
run: oj-verify docs --jobs 4
- name: Generate API docs
if: ${{ github.event_name == 'push' && matrix.version == '1.7.2' }}
if: ${{ github.event_name == 'push' && matrix.version == '1.9.1' }}
run: crystal docs --progress --stats --time -o dist/api
- name: Build bundled docs
if: ${{ github.event_name == 'push' && matrix.version == '1.7.2' }}
if: ${{ github.event_name == 'push' && matrix.version == '1.9.1' }}
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
if: ${{ github.event_name == 'push' && matrix.version == '1.7.2' }}
if: ${{ github.event_name == 'push' && matrix.version == '1.9.1' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
10 changes: 5 additions & 5 deletions .verify-helper/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ if [ "$filename" -nt "${output}" ]; then
/tmp/crystal-0.33.0-1/bin/crystal build "$filename" -o "${output}" --error-trace $@ || exit 1
elif [[ "`crystal version`" == *"0.33.0"* ]]; then
crystal build "$filename" -o "${output}" --error-trace $@ || exit 1
elif [ -d /usr/local/share/crystal-1.7.2-1 ]; then
/usr/local/share/crystal-1.7.2-1/bin/crystal build "$filename" -o "${output}" --error-trace $@ || exit 1
elif [ -d /tmp/crystal-1.7.2-1 ]; then
/tmp/crystal-1.7.2-1/bin/crystal build "$filename" -o "${output}" --error-trace $@ || exit 1
elif [[ "`crystal version`" == *"1.7.2"* ]]; then
elif [ -d /usr/local/share/crystal-1.9.1 ]; then
/usr/local/share/crystal-1.9.1/bin/crystal build "$filename" -o "${output}" --error-trace $@ || exit 1
elif [ -d /tmp/crystal-1.9.1 ]; then
/tmp/crystal-1.9.1/bin/crystal build "$filename" -o "${output}" --error-trace $@ || exit 1
elif [[ "`crystal version`" == *"1.9.1"* ]]; then
crystal build "$filename" -o "${output}" --error-trace $@ || exit 1
else
docker run -v "$PWD":/mnt crystallang/crystal:0.33.0 crystal build "/mnt/$filename" -o "/mnt/${output}" --error-trace $@ || exit 1
Expand Down
2 changes: 1 addition & 1 deletion shard.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2.0
shards:
ameba:
git: https://github.com/crystal-ameba/ameba.git
version: 1.4.0
version: 1.5.0

cr-bundle:
git: https://github.com/yuruhi/cr-bundle.git
Expand Down
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ license: Apache-2.0
development_dependencies:
ameba:
github: crystal-ameba/ameba
version: 1.4.0
version: 1.5.0
cr-bundle:
github: yuruhi/cr-bundle
branch: main
Expand Down

0 comments on commit 29255df

Please sign in to comment.