Skip to content

Commit

Permalink
ci: separate unit & e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
phm07 committed Sep 18, 2024
1 parent 66ea955 commit b8afca8
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 2 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ jobs:
with:
go-version: "1.23"

- uses: hetznercloud/tps-action@main

- name: Run tests
run: go test -coverpkg=./... -coverprofile=coverage.txt -v -race ./...

Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/e2e_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: E2E Tests

on:
push:
branches: [main]
pull_request:

jobs:
test:
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.23"

- uses: hetznercloud/tps-action@main

- name: Run tests
run: go test -tags e2e -coverpkg=./... -coverprofile=coverage.txt -v -race ./e2e_test

- name: Upload coverage reports to Codecov
if: >
!startsWith(github.head_ref, 'renovate/') &&
!startsWith(github.head_ref, 'release-please--')
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 2 additions & 0 deletions e2e_test/combined_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build e2e

package e2e_test

import (
Expand Down
2 changes: 2 additions & 0 deletions e2e_test/datacenter_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build e2e

package e2e_test

import (
Expand Down
2 changes: 2 additions & 0 deletions e2e_test/e2e_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build e2e

package e2e_test

import (
Expand Down
2 changes: 2 additions & 0 deletions e2e_test/firewall_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build e2e

package e2e_test

import (
Expand Down
2 changes: 2 additions & 0 deletions e2e_test/floatingip_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build e2e

package e2e_test

import (
Expand Down
2 changes: 2 additions & 0 deletions e2e_test/network_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build e2e

package e2e_test

import (
Expand Down
2 changes: 2 additions & 0 deletions e2e_test/placement_group_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build e2e

package e2e_test

import (
Expand Down
2 changes: 2 additions & 0 deletions e2e_test/server_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//go:build e2e

package e2e_test

import (
Expand Down

0 comments on commit b8afca8

Please sign in to comment.