From 768b5d706a0e1667a12f3dd86a2a8a3505b4e94a Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto Date: Thu, 11 Jun 2026 16:58:39 +0200 Subject: [PATCH 1/2] chore: add CI validation jobs --- .github/workflows/unit-tests.yml | 46 ++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 44741f4..3bf12ee 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -6,8 +6,13 @@ on: branches: - main +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + jobs: test: + name: RSpec (Ruby ${{ matrix.ruby-version }}) runs-on: ubuntu-latest strategy: matrix: @@ -29,9 +34,40 @@ jobs: bundler-cache: true - name: Run RSpec tests - run: | - bundle exec rspec + run: bundle exec rspec + + rubocop: + name: RuboCop + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Use Ruby 3.4 + uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0 + with: + ruby-version: 3.4 + bundler: 4.0.13 + bundler-cache: true + + - name: Run RuboCop + run: bundle exec rubocop + + gem-build: + name: Gem build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Use Ruby 3.4 + uses: ruby/setup-ruby@319994f95fa847cf3fb3cd3dbe89f6dcde9f178f # v1.295.0 + with: + ruby-version: 3.4 + bundler: 4.0.13 + bundler-cache: true + + - name: Build posthog-ruby gem + run: gem build posthog-ruby.gemspec - - name: Run Rubocop - run: | - bundle exec rubocop + - name: Build posthog-rails gem + run: gem build posthog-rails.gemspec + working-directory: posthog-rails From 82d1b890cc860109bf673b38452e62c59990924a Mon Sep 17 00:00:00 2001 From: Manoel Aranda Neto Date: Thu, 11 Jun 2026 17:18:59 +0200 Subject: [PATCH 2/2] chore: limit workflow token permissions --- .github/workflows/unit-tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 3bf12ee..7f61393 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -10,6 +10,9 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true +permissions: + contents: read + jobs: test: name: RSpec (Ruby ${{ matrix.ruby-version }})