diff --git a/.github/actions/perform_smoke_test/action.yaml b/.github/actions/perform_smoke_test/action.yaml index 90e5cd93..89f63cad 100644 --- a/.github/actions/perform_smoke_test/action.yaml +++ b/.github/actions/perform_smoke_test/action.yaml @@ -208,7 +208,8 @@ runs: ./${{ inputs.cli-binary-location }} upload \ --org-url-slug trunk \ --junit-paths "${{ github.workspace }}/target/**/*junit.xml" \ - --token ${{ inputs.production-api-token }} + --token ${{ inputs.production-api-token }} \ + --test-collection-id 4B2wfoEU - name: Upload to production with public repo id id: production-upload-public-repo-id diff --git a/.github/actions/test_ruby_gem_uploads/action.yaml b/.github/actions/test_ruby_gem_uploads/action.yaml index 41a9e4af..900c6b02 100644 --- a/.github/actions/test_ruby_gem_uploads/action.yaml +++ b/.github/actions/test_ruby_gem_uploads/action.yaml @@ -27,6 +27,9 @@ inputs: test-collection-id: description: Optional 8 character alphanumeric ID for a test collection required: false + variant: + description: Optional variant label to distinguish uploads within a matrix + required: false knapsack-pro-test-suite-token-rspec: description: Optional Knapsack Pro test suite token for RSpec required: true @@ -87,6 +90,7 @@ runs: TRUNK_ORG_URL_SLUG: ${{ inputs.trunk-org-slug }} TRUNK_API_TOKEN: ${{ inputs.trunk-token }} TRUNK_TEST_COLLECTION_ID: ${{ inputs.test-collection-id }} + TRUNK_VARIANT: ${{ inputs.variant }} - name: Run variant quarantine test without variant (should fail - not quarantined) id: run-variant-test-no-variant @@ -171,6 +175,8 @@ runs: TRUNK_API_TOKEN: ${{ inputs.trunk-token }} TRUNK_ORG_URL_SLUG: ${{ inputs.trunk-org-slug }} TRUNK_PUBLIC_API_ADDRESS: ${{ inputs.trunk-public-api-address }} + TRUNK_TEST_COLLECTION_ID: ${{ inputs.test-collection-id }} + TRUNK_VARIANT: ${{ inputs.variant }} TRUNK_LOCAL_UPLOAD_DIR: bundles run: | set -euo pipefail diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index e5c7a008..90f0de3b 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -216,7 +216,8 @@ jobs: target/${{ matrix.platform.target }}/release/trunk-analytics-cli upload \ --junit-paths ${{ github.workspace }}/target/**/*junit.xml \ --org-url-slug trunk \ - --token ${{ secrets.TRUNK_PROD_ORG_API_TOKEN }} + --token ${{ secrets.TRUNK_PROD_ORG_API_TOKEN }} \ + --test-collection-id EWhNPVic trunk_check_runner: name: Trunk Check runner [linux] diff --git a/.github/workflows/release_ruby_gem.yml b/.github/workflows/release_ruby_gem.yml index b17096ca..253e7427 100644 --- a/.github/workflows/release_ruby_gem.yml +++ b/.github/workflows/release_ruby_gem.yml @@ -128,12 +128,29 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/test_ruby_gem_uploads + - name: Test ruby gem uploads → analytics-cli-ruby-gem (staging) + uses: ./.github/actions/test_ruby_gem_uploads with: ruby-version: ${{ matrix.ruby-version }} trunk-token: ${{ secrets.TRUNK_STAGING_ORG_API_TOKEN }} + trunk-public-api-address: https://api.trunk-staging.io + trunk-org-slug: trunk-staging-org test-collection-id: T5yKSn9h platform: ${{ matrix.platform.name }} + variant: ${{ matrix.platform.name }}-ruby${{ matrix.ruby-version }} + artifact-pattern: cross-gem-${{ matrix.platform.name }} + knapsack-pro-test-suite-token-rspec: ${{ secrets.KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC }} + + - name: Test ruby gem uploads → analytics-cli-ruby-gem (prod) + uses: ./.github/actions/test_ruby_gem_uploads + with: + ruby-version: ${{ matrix.ruby-version }} + trunk-token: ${{ secrets.TRUNK_PROD_ORG_API_TOKEN }} + trunk-public-api-address: https://api.trunk.io + trunk-org-slug: trunk + test-collection-id: BiBP2neA + platform: ${{ matrix.platform.name }} + variant: ${{ matrix.platform.name }}-ruby${{ matrix.ruby-version }} artifact-pattern: cross-gem-${{ matrix.platform.name }} knapsack-pro-test-suite-token-rspec: ${{ secrets.KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC }} diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index ac0d4653..66360420 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -25,16 +25,61 @@ jobs: - name: Setup Ruby uses: ./.github/actions/setup_ruby + - name: Build CLI + run: cargo build -p trunk-analytics-cli + - name: Test ruby package if: "!cancelled()" run: | bundle install bundle exec rake test working-directory: rspec-trunk-flaky-tests + env: + TRUNK_LOCAL_UPLOAD_DIR: ../upload_bundle + + - name: Upload ruby package results → analytics-cli-ruby-gem (staging) + if: "!cancelled()" + run: | + ./target/debug/trunk-analytics-cli upload \ + --org-url-slug trunk-staging-org \ + --token ${{ secrets.TRUNK_STAGING_ORG_API_TOKEN }} \ + --test-reports ./upload_bundle/trunk_output.bin \ + --test-collection-id T5yKSn9h + env: + TRUNK_PUBLIC_API_ADDRESS: https://api.trunk-staging.io + + - name: Upload ruby package results → analytics-cli-ruby-gem (prod) + if: "!cancelled()" + run: | + ./target/debug/trunk-analytics-cli upload \ + --org-url-slug trunk \ + --token ${{ secrets.TRUNK_PROD_ORG_API_TOKEN }} \ + --test-reports ./upload_bundle/trunk_output.bin \ + --test-collection-id BiBP2neA + env: + TRUNK_PUBLIC_API_ADDRESS: https://api.trunk.io + + - name: Upload ruby package results → analytics-cli-smoke-tests (staging) + if: "!cancelled()" + run: | + ./target/debug/trunk-analytics-cli upload \ + --org-url-slug trunk-staging-org \ + --token ${{ secrets.TRUNK_STAGING_ORG_API_TOKEN }} \ + --test-reports ./upload_bundle/trunk_output.bin \ + --test-collection-id z2dzjLHm env: TRUNK_PUBLIC_API_ADDRESS: https://api.trunk-staging.io - TRUNK_ORG_URL_SLUG: trunk-staging-org - TRUNK_API_TOKEN: ${{ secrets.TRUNK_STAGING_ORG_API_TOKEN }} + + - name: Upload ruby package results → analytics-cli-smoke-tests (prod) + if: "!cancelled()" + run: | + ./target/debug/trunk-analytics-cli upload \ + --org-url-slug trunk \ + --token ${{ secrets.TRUNK_PROD_ORG_API_TOKEN }} \ + --test-reports ./upload_bundle/trunk_output.bin \ + --test-collection-id 4B2wfoEU + env: + TRUNK_PUBLIC_API_ADDRESS: https://api.trunk.io - name: Validate ruby platform gem if: "!cancelled()" @@ -112,7 +157,8 @@ jobs: name: ruby-gem-pr path: .github/actions/test_ruby_gem_uploads/ - - uses: ./.github/actions/test_ruby_gem_uploads + - name: Test ruby gem uploads → analytics-cli-ruby-gem (staging) + uses: ./.github/actions/test_ruby_gem_uploads with: ruby-version: "3.4" trunk-token: ${{ secrets.TRUNK_STAGING_ORG_API_TOKEN }} @@ -122,3 +168,39 @@ jobs: platform: x86_64-linux artifact-pattern: "" knapsack-pro-test-suite-token-rspec: ${{ secrets.KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC }} + + - name: Test ruby gem uploads → analytics-cli-ruby-gem (prod) + uses: ./.github/actions/test_ruby_gem_uploads + with: + ruby-version: "3.4" + trunk-token: ${{ secrets.TRUNK_PROD_ORG_API_TOKEN }} + trunk-public-api-address: https://api.trunk.io + trunk-org-slug: trunk + test-collection-id: BiBP2neA + platform: x86_64-linux + artifact-pattern: "" + knapsack-pro-test-suite-token-rspec: ${{ secrets.KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC }} + + - name: Test ruby gem uploads → analytics-cli-smoke-tests (staging) + uses: ./.github/actions/test_ruby_gem_uploads + with: + ruby-version: "3.4" + trunk-token: ${{ secrets.TRUNK_STAGING_ORG_API_TOKEN }} + trunk-public-api-address: https://api.trunk-staging.io + trunk-org-slug: trunk-staging-org + test-collection-id: z2dzjLHm + platform: x86_64-linux + artifact-pattern: "" + knapsack-pro-test-suite-token-rspec: ${{ secrets.KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC }} + + - name: Test ruby gem uploads → analytics-cli-smoke-tests (prod) + uses: ./.github/actions/test_ruby_gem_uploads + with: + ruby-version: "3.4" + trunk-token: ${{ secrets.TRUNK_PROD_ORG_API_TOKEN }} + trunk-public-api-address: https://api.trunk.io + trunk-org-slug: trunk + test-collection-id: 4B2wfoEU + platform: x86_64-linux + artifact-pattern: "" + knapsack-pro-test-suite-token-rspec: ${{ secrets.KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC }}