Skip to content

Add support for components containing ERB files #127

Add support for components containing ERB files

Add support for components containing ERB files #127

Workflow file for this run

name: CI
on:
push:
branches: ["main", "master"]
pull_request:
branches: ["main", "master"]
workflow_dispatch:
schedule:
- cron: "0 6 * * 1"
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Test Ruby ${{ matrix.ruby-version }}
runs-on: ubuntu-latest
env:
BUNDLE_PATH: vendor/bundle
BUNDLE_DISABLE_SHARED_GEMS: "true"
strategy:
fail-fast: false
matrix:
ruby-version: ["3.2", "3.3", "3.4", "4.0"]
steps:
- uses: actions/checkout@v6
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Check syntax
run: find lib test -name "*.rb" -print0 | xargs -0 -n1 ruby -c && ruby -c exe/archspec
- name: Run tests
run: bundle exec rake test
- name: Run architecture checks
run: bundle exec rake architecture
- name: Build gem
run: gem build archspec.gemspec
test_musl:
name: Test Ruby 3.4 on Alpine (musl)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Test from the source gem on musl
run: |
docker run --rm \
--volume "$PWD:/workspace" \
--workdir /workspace \
--env BUNDLE_PATH=/tmp/bundle \
--env BUNDLE_DISABLE_SHARED_GEMS=true \
--env BUNDLE_FORCE_RUBY_PLATFORM=true \
ruby:3.4-alpine sh -elc '
apk add --no-cache build-base cargo clang-dev git
bundle install
find lib test -name "*.rb" -print0 | xargs -0 -n1 ruby -c
ruby -c exe/archspec
bundle exec rake test
bundle exec rake architecture
gem build archspec.gemspec
'
torture:
name: Torture against Fizzy
runs-on: ubuntu-latest
env:
BUNDLE_PATH: vendor/bundle
BUNDLE_DISABLE_SHARED_GEMS: "true"
steps:
- uses: actions/checkout@v6
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "4.0"
bundler-cache: true
- name: Run Fizzy torture test
env:
ARCHSPEC_TORTURE: "1"
run: bundle exec ruby -Itest test/torture_test.rb -n test_fizzy
torture_apps:
name: Torture against Discourse and Mastodon
# Discourse and Mastodon are large checkouts, so only run them at release
# (push to the default branch) and on manual or scheduled runs.
if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' || (github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'))
runs-on: ubuntu-latest
env:
BUNDLE_PATH: vendor/bundle
BUNDLE_DISABLE_SHARED_GEMS: "true"
steps:
- uses: actions/checkout@v6
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "4.0"
bundler-cache: true
- name: Run Discourse and Mastodon torture tests
env:
ARCHSPEC_TORTURE: "1"
run: bundle exec ruby -Itest test/torture_test.rb -n "/test_(discourse|mastodon)/"
docs:
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
env:
BUNDLE_PATH: vendor/bundle
BUNDLE_DISABLE_SHARED_GEMS: "true"
steps:
- uses: actions/checkout@v6
- name: Set up Ruby for API docs (root Gemfile)
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
- name: Set up Ruby for Jekyll build (docs Gemfile)
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
working-directory: docs
- name: Set up Pages
id: pages
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
uses: actions/configure-pages@v5
- name: Build docs
working-directory: docs
run: |
if [ -n "${PAGES_BASE_PATH}" ]; then
bundle exec jekyll build --baseurl "${PAGES_BASE_PATH}"
else
bundle exec jekyll build
fi
env:
PAGES_BASE_PATH: ${{ steps.pages.outputs.base_path }}
- name: Build API docs (RDoc) into /api/
run: docs/bin/build-api.sh docs/_site/api
- name: Audit generated SEO
run: docs/bin/audit-seo.rb docs/_site
- name: Upload Pages artifact
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
uses: actions/upload-pages-artifact@v4
with:
path: docs/_site
deploy_docs:
name: Deploy docs
needs: [test, docs]
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
release:
name: Release gem
needs: [test, test_musl, docs, torture, torture_apps]
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
uses: ./.github/workflows/release.yml
permissions:
contents: write
secrets: inherit