Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Martí <[email protected]>
Change-Id: I7f687dc31010bc0e0005d3385c8388c6657d5362
  • Loading branch information
mvdan committed Nov 1, 2023
1 parent 8c826bc commit 444ceab
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/trybot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,15 @@ jobs:
run: go test -race ./...
env:
GORACE: atexit_sleep_ms=10
- if: |-
((github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-branch.')) && (! (contains(github.event.head_commit.message, '
Dispatch-Trailer: {"type":"')))) && (matrix.go-version == '1.21.x' && matrix.runner == 'ubuntu-22.04')
name: End-to-end test
run: |-
cd internal/e2e
go test
env:
GITHUB_TOKEN: ${{ secrets.E2E_GITHUB_TOKEN }}
- if: (matrix.go-version == '1.21.x' && matrix.runner == 'ubuntu-22.04')
name: Check
run: go vet ./...
Expand Down
14 changes: 14 additions & 0 deletions internal/ci/github/trybot.cue
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ workflows: trybot: _repo.bashWorkflow & {
_goTestRace & {
if: _isLatestLinux
},
_e2eTest,
_goCheck,
_repo.checkGitClean,
]
Expand Down Expand Up @@ -114,6 +115,19 @@ workflows: trybot: _repo.bashWorkflow & {
run: "go test ./..."
}

_e2eTest: json.#step & {
name: "End-to-end test"
// The end-to-end tests require the GITHUB_TOKEN secret and are a bit slow,
// so we only run them on pushes to protected branches and on one environment.
if: "\(_repo.isProtectedBranch) && \(_isLatestLinux)"
// Note that Actions runs with a default GITHUB_TOKEN, which we override here.
env: GITHUB_TOKEN: "${{ secrets.E2E_GITHUB_TOKEN }}"
run: """
cd internal/e2e
go test
"""
}

_goCheck: json.#step & {
// These checks can vary between platforms, as different code can be built
// based on GOOS and GOARCH build tags.
Expand Down

0 comments on commit 444ceab

Please sign in to comment.