ci: Refactor CI workflow with build matrix #389
Workflow file for this run
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: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
jekyll-build: | |
runs-on: ubuntu-latest | |
name: Jekyll Build (YJIT_ENABLED ${{ matrix.yjit-enabled }}) | |
strategy: | |
matrix: | |
yjit-enabled: [0, 1] | |
env: | |
RUBY_YJIT_ENABLE: ${{ matrix.yjit-enabled }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.3 | |
bundler-cache: true | |
- name: Jekyll Build | |
run: bundle exec jekyll build | |
doc-build-latest: | |
runs-on: ubuntu-latest | |
name: Rails Doc Build (latest, YJIT_ENABLED ${{ matrix.yjit-enabled }}) | |
strategy: | |
matrix: | |
yjit-enabled: [0, 1] | |
env: | |
RUBY_YJIT_ENABLE: ${{ matrix.yjit-enabled }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: fetch Rails tags | |
run: cd rails && git fetch --depth=1 origin refs/tags/v7*:refs/tags/v7* | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.3 | |
bundler-cache: true | |
- name: Doc Build | |
run: rake build | |
doc-build-others: | |
runs-on: ubuntu-latest | |
name: Rails Doc Build (older versions) | |
strategy: | |
matrix: | |
include: | |
- ruby-version: 2.7 | |
build-rails-versions: "5.2,6.0,6.1" | |
- ruby-version: 3.3 | |
build-rails-versions: "7.0,7.1,7.2" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: fetch Rails tags | |
working-directory: rails | |
run: | | |
for version in $(echo "${{ matrix.build-rails-versions }}" | tr ',' ' '); do | |
git fetch --depth=1 origin refs/tags/v${version}*:refs/tags/v${version}* | |
done | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby-version }} | |
bundler-cache: true | |
- name: Doc Build | |
run: rake 'build_multi[${{ matrix.build-rails-versions }}]' |