diff --git a/.github/workflows/github-actions-ci-brakeman.yml b/.github/workflows/github-actions-ci-brakeman.yml index 0418549..bc54994 100644 --- a/.github/workflows/github-actions-ci-brakeman.yml +++ b/.github/workflows/github-actions-ci-brakeman.yml @@ -9,13 +9,19 @@ on: jobs: brakeman: - runs-on: ubuntu-latest + strategy: + matrix: + os: [ubuntu-latest] + ruby: ['3.2.2'] + runs-on: ${{ matrix.os }} + steps: - name: Checkout code uses: actions/checkout@v3 - name: Install Ruby and gems uses: ruby/setup-ruby@v1 with: + ruby-version: ${{ matrix.ruby }} bundler-cache: true - name: Security audit application code run: bundle exec brakeman -q -w2 diff --git a/.github/workflows/github-actions-ci-jest.yml b/.github/workflows/github-actions-ci-jest.yml index e914fdb..6c7275f 100644 --- a/.github/workflows/github-actions-ci-jest.yml +++ b/.github/workflows/github-actions-ci-jest.yml @@ -4,31 +4,20 @@ on: pull_request jobs: jest-test: - - runs-on: ubuntu-latest - strategy: matrix: - node-version: [14.x] - + os: [ubuntu-latest] + node: [14.x] + runs-on: ${{ matrix.os }} steps: - name: Checkout code - uses: actions/checkout@v2 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} + uses: actions/checkout@v3 - - name: Cache Node.js modules - uses: actions/cache@v2 + - name: Use Node.js ${{ matrix.node }} + uses: actions/setup-node@v3 with: - # npm cache files are stored in `~/.npm` on Linux/macOS - path: ~/.npm - key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.OS }}-node- - ${{ runner.OS }}- + node-version: ${{ matrix.node }} + cache: 'yarn' - name: Install dependencies run: yarn install --pure-lockfile diff --git a/.github/workflows/github-actions-ci-lint.yml b/.github/workflows/github-actions-ci-lint.yml index ef30fa4..39d03fe 100644 --- a/.github/workflows/github-actions-ci-lint.yml +++ b/.github/workflows/github-actions-ci-lint.yml @@ -1,58 +1,38 @@ +name: Pronto + on: [pull_request] -name: Pronto +permissions: + contents: read + pull-requests: write + statuses: write jobs: linters: name: Linters - runs-on: ubuntu-latest strategy: matrix: - ruby-version: [2.7] + os: [ubuntu-latest] + ruby: ['3.2.2'] + runs-on: ${{ matrix.os }} steps: - name: Checkout code uses: actions/checkout@v2 - run: | - git fetch --no-tags --prune --depth=10 origin +refs/heads/*:refs/remotes/origin/* + git fetch --no-tags --prune --depth=60 origin +refs/heads/*:refs/remotes/origin/* - name: Setup Ruby uses: ruby/setup-ruby@v1 - - - name: Ruby gem cache - uses: actions/cache@v1 with: - path: vendor/bundle - key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} - restore-keys: | - ${{ runner.os }}-gems- - - - name: Install gems - run: | - bundle config path vendor/bundle - bundle install --jobs 4 --retry 3 - - - name: Setup Node - uses: actions/setup-node@v1 - with: - node-version: 14.x - - - name: Find yarn cache location - id: yarn-cache - run: echo "::set-output name=dir::$(yarn cache dir)" - - - name: JS package cache - uses: actions/cache@v1 - with: - path: ${{ steps.yarn-cache.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - - name: Install packages - run: | - yarn install --pure-lockfile + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + + - name: Setup pronto + run: gem install pronto pronto-rubocop - name: Run Pronto - run: | - PRONTO_PULL_REQUEST_ID="${{ github.event.pull_request.number }}" PRONTO_GITHUB_ACCESS_TOKEN="${{ github.token }}" bundle exec pronto run -f github_status github_pr -c origin/${{ github.base_ref }} + run: bundle exec pronto run -f github_status github_pr -c origin/${{ github.base_ref }} + env: + PRONTO_PULL_REQUEST_ID: ${{ github.event.pull_request.number }} + PRONTO_GITHUB_ACCESS_TOKEN: "${{ github.token }}" \ No newline at end of file diff --git a/.github/workflows/github-actions-ci-rspec.yml b/.github/workflows/github-actions-ci-rspec.yml index d88ecd7..4aa42c1 100644 --- a/.github/workflows/github-actions-ci-rspec.yml +++ b/.github/workflows/github-actions-ci-rspec.yml @@ -4,12 +4,11 @@ on: pull_request jobs: rspec-test: - - runs-on: ubuntu-latest - strategy: matrix: - ruby-version: [2.7] + os: [ubuntu-latest] + ruby: ["3.2.2"] + runs-on: ${{ matrix.os }} # Service containers to run with `container-job` services: @@ -34,40 +33,21 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - - name: Set up Ruby ${{ matrix.ruby-version }} + - name: Set up Ruby ${{ matrix.ruby }} uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ matrix.ruby-version }} + ruby-version: ${{ matrix.ruby }} bundler-cache: true - - - name: Install dependencies env: - RAILS_ENV: test - RAILS_GROUPS: development - run: | - bundle install + BUNDLE_WITH: development - name: Copy database config yml run: cp test/dummy/config/ci.database.yml test/dummy/config/database.yml - - name: Create db - env: - RAILS_ENV: test - run: bin/rails db:create - - name: Run migrations env: RAILS_ENV: test run: bin/rails db:migrate - - - name: Prepare assets - env: - RAILS_ENV: test - run: bundle exec rake db:test:prepare - - - name: Run tests - env: - RAILS_ENV: test - run: bundle exec rspec - + - name: Preparing assets and running tests + run: bundle exec rake