github action for CI #1
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: activescaffold/active_scaffold | ||
on: | ||
push: | ||
pull_request: | ||
concurrency: | ||
group: "${{ github.ref }}" | ||
cancel-in-progress: true | ||
env: | ||
CC_TEST_REPORTER_ID: 8a344833c6693733b163f09a5243fa12dd7be0b69f0358b146c64dd4becabc60 | ||
jobs: | ||
lint-brakeman: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
steps: | ||
- uses: actions/checkout@v4.1.0 | ||
with: | ||
lfs: true | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
- run: bundle exec brakeman --exit-on-warn --output brakeman/index.html | ||
- uses: actions/upload-artifact@v4.1.0 | ||
if: always() | ||
with: | ||
name: "${{ github.job }}" | ||
retention-days: 1 | ||
path: brakeman | ||
lint-bundler-audit: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
steps: | ||
- uses: actions/checkout@v4.1.0 | ||
with: | ||
lfs: true | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
- run: bundle exec bundle-audit check --update --verbose | ||
lint-i18n: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ruby:3.0-alpine | ||
timeout-minutes: 60 | ||
continue-on-error: true | ||
steps: | ||
- uses: actions/checkout@v4.1.0 | ||
with: | ||
lfs: true | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
- run: bundle exec i18n-tasks health | ||
lint-rubocop: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ruby:3.0-alpine | ||
timeout-minutes: 60 | ||
steps: | ||
- uses: actions/checkout@v4.1.0 | ||
with: | ||
lfs: true | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
- run: bundle exec rubocop | ||
test: | ||
name: Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }} | ||
needs: | ||
- lint-brakeman | ||
- lint-bundler-audit | ||
- lint-i18n | ||
- lint-rubocop | ||
runs-on: ubuntu-latest | ||
matrix: | ||
ruby: [ "3.2", "3.1", "3.0", "2.7", "2.6", "2.5", jruby-9.4 ] | ||
rails: [ "6.1", "6.0", "5.2" ] | ||
timeout-minutes: 60 | ||
env: | ||
JRUBY_OPTS: "--debug" | ||
LC_ALL: C.UTF-8 | ||
RAILS_ENV: test | ||
BUNDLE_GEMFILE: gemfiles/Gemfile.rails-${{ matrix.rails }}.x | ||
steps: | ||
- uses: actions/checkout@v4.1.0 | ||
with: | ||
lfs: true | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
- run: bundle exec rake | ||
- uses: actions/upload-artifact@v4.1.0 | ||
if: success() | ||
with: | ||
name: "${{ github.job }}" | ||
retention-days: 1 | ||
path: coverage |