From e99c2dc187cfccff8d71f9ecae424e766b489f74 Mon Sep 17 00:00:00 2001 From: Sergio Cambra Date: Wed, 25 Sep 2024 16:38:36 +0200 Subject: [PATCH] github action for CI --- .github/workflows/ci.yml | 96 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..b4c31c9e0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,96 @@ +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 \ No newline at end of file