E2E Tests #13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: E2E Tests | |
| on: | |
| push: | |
| branches: [v3.0] | |
| pull_request: | |
| branches: [v3.0] | |
| workflow_dispatch: | |
| inputs: | |
| e2e_tests_ref: | |
| description: 'Branch or ref of sdk-e2e-tests to use' | |
| required: false | |
| default: 'main' | |
| permissions: | |
| id-token: write | |
| contents: read | |
| env: | |
| ARTIFACTORY_URL: ${{ vars.ARTIFACTORY_URL }} | |
| jobs: | |
| e2e-tests: | |
| if: ${{ !github.event.pull_request.head.repo.fork }} | |
| runs-on: ubuntu-x64 | |
| steps: | |
| - name: Checkout SDK | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| with: | |
| path: sdk | |
| - name: Checkout sdk-e2e-tests | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
| with: | |
| repository: segmentio/sdk-e2e-tests | |
| ref: ${{ inputs.e2e_tests_ref || 'main' }} | |
| path: sdk-e2e-tests | |
| - name: Setup Go | |
| uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5 | |
| with: | |
| go-version-file: sdk/go.mod | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Authenticate to Artifactory | |
| uses: ./sdk/.github/actions/artifactory-oidc | |
| - name: Build e2e-cli | |
| working-directory: sdk/e2e-cli | |
| run: go build -o e2e-cli-bin ./... | |
| - name: Run E2E tests | |
| working-directory: sdk-e2e-tests | |
| run: | | |
| ./scripts/run-tests.sh \ | |
| --sdk-dir "${{ github.workspace }}/sdk/e2e-cli" \ | |
| --cli "${{ github.workspace }}/sdk/e2e-cli/e2e-cli-bin" | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: e2e-test-results | |
| path: sdk-e2e-tests/test-results/ | |
| if-no-files-found: ignore |