diff --git a/.github/workflows/integration-test.yaml b/.github/workflows/integration-test.yaml new file mode 100644 index 0000000..4725c8d --- /dev/null +++ b/.github/workflows/integration-test.yaml @@ -0,0 +1,43 @@ +name: integration-test + +on: + pull_request_review: + types: [submitted] + paths: + - '**.go' + - 'go.mod' + - 'go.sum' + - '.github/workflows/integration-test.yaml' + +permissions: + contents: read + +jobs: + integration-test: + if: github.event.review.state == 'approved' + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout PR + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: Setup Go + uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 + with: + go-version-file: "go.mod" + + - name: Build + run: make build + + - name: Run integration tests + env: + UPCLOUD_USERNAME: ${{ secrets.UPCLOUD_API_USER }} + UPCLOUD_PASSWORD: ${{ secrets.UPCLOUD_API_PASSWORD }} + PACKER_ACC: 1 + run: make test_integration diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 3b338cb..c3680a0 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -28,12 +28,5 @@ jobs: - name: Build run: make build - - name: Run unit-tests + - name: Run unit tests run: make test - - - name: Run acceptance tests - env: - UPCLOUD_USERNAME: ${{ secrets.UPCLOUD_API_USER }} - UPCLOUD_PASSWORD: ${{ secrets.UPCLOUD_API_PASSWORD }} - PACKER_ACC: 1 - run: make test_integration