Merge pull request #46 from thalassa-cloud/dependabot/go_modules/k8s.… #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: | |
| - main | |
| env: | |
| TCLOUD_E2E_ORGANISATION: "o-d5obcgg3fspc73f7vqpg" | |
| THALASSA_SERVICE_ACCOUNT_ID: "sa-d5obd77ua50s73ab91ig" | |
| TCLOUD_E2E_API_ENDPOINT: "https://api.thalassa.cloud" | |
| jobs: | |
| e2e-tests: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write | |
| contents: read | |
| strategy: | |
| matrix: | |
| go-version: ["1.24"] | |
| steps: | |
| - name: Set up Go ${{ matrix.go-version }} | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: ${{ matrix.go-version }} | |
| - name: Check out code into the Go module directory | |
| uses: actions/checkout@v4 | |
| - name: Get OIDC Token | |
| id: oidc | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const token = await core.getIDToken(); | |
| core.setOutput('token', token); | |
| - name: Exchange OIDC Token | |
| id: auth | |
| run: | | |
| # Exchange GitHub OIDC token for Thalassa Cloud bearer token | |
| RESPONSE=$(curl -X POST https://api.thalassa.cloud/oidc/token \ | |
| -H "Content-Type: application/x-www-form-urlencoded" \ | |
| -d "grant_type=urn:ietf:params:oauth:grant-type:token-exchange" \ | |
| -d "subject_token=${{ steps.oidc.outputs.token }}" \ | |
| -d "subject_token_type=urn:ietf:params:oauth:token-type:id_token" \ | |
| -d "organisation_id=${{ env.TCLOUD_E2E_ORGANISATION }}" \ | |
| -d "service_account_id=${{ env.THALASSA_SERVICE_ACCOUNT_ID }}") | |
| TCLOUD_E2E_ACCESS_TOKEN=$(echo "$RESPONSE" | jq -r '.access_token') | |
| echo "TCLOUD_E2E_ACCESS_TOKEN=$TCLOUD_E2E_ACCESS_TOKEN" >> $GITHUB_ENV | |
| # setup gotestsum | |
| - name: Setup gotestsum | |
| run: go install gotest.tools/gotestsum@latest | |
| - name: Run E2E tests | |
| run: make test-e2e |