name: CI on: push: branches: - main pull_request: schedule: - cron: '0 0 * * 0' # weekly jobs: build: runs-on: ubuntu-latest name: Ruby ${{ matrix.ruby }} AR ${{ matrix.activerecord }} timeout-minutes: 10 env: BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/ar_${{ matrix.activerecord }}.gemfile strategy: fail-fast: false matrix: ruby: [2.6, 2.7, 3.0] activerecord: [60, 61] steps: - uses: actions/checkout@v2 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - name: Rubocop run: bundle exec rubocop - name: Run tests run: bundle exec rake publish: if: github.event_name == 'push' && github.ref == 'refs/heads/main' needs: build runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Release gem uses: discourse/publish-rubygems-action@v2 env: RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }} GIT_EMAIL: team@discourse.org GIT_NAME: discoursebot