Skip to content

Commit

Permalink
ci: upgrade action templates
Browse files Browse the repository at this point in the history
  • Loading branch information
malud committed Sep 9, 2024
1 parent 979cc79 commit 7f227f1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 45 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:
timeout-minutes: 10
steps:
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Docker meta
id: meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v5
with:
images: coupergateway/couper-oidc-gateway
tags: |
Expand All @@ -34,20 +34,20 @@ jobs:
type=edge,event=branch
- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Build and push docker image with tag
if: ${{ github.event.client_payload.version != 'edge' && github.event.inputs.edge_build != 'true' }}
uses: docker/build-push-action@v2
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
Expand All @@ -57,7 +57,7 @@ jobs:

- name: Build and push docker edge image
if: ${{ github.event.client_payload.version == 'edge' || github.event.inputs.edge_build == 'true' }}
uses: docker/build-push-action@v2
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
Expand All @@ -68,7 +68,7 @@ jobs:
COUPER_VERSION=${{ github.event.client_payload.version || 'edge' }}
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v2
uses: peter-evans/dockerhub-description@v4
with:
readme-filepath: './README.md'
username: '${{ secrets.DOCKER_USERNAME }}'
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@ jobs:
timeout-minutes: 10
steps:
- name: checkout
uses: actions/checkout@v2
- name: 'setup docker'
uses: docker-practice/actions-setup-docker@master
uses: actions/checkout@v4
- name: 'setup go'
uses: actions/setup-go@v2
uses: actions/setup-go@v5
with:
go-version: '1.18'
go-version: 'stable'
- name: 'setup go dep'
run: go mod download
- uses: hoverkraft-tech/compose-action@v2.0.1
with:
compose-file: "./test/docker-compose.yml"
- name: 'test with coupergateway/couper'
run: |
docker version
Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
.PHONY: test
.PHONY: test test-local

test:
go mod download
go test -v -race -timeout 60s -count 1 main_test.go

test-local:
docker compose -f ./test/docker-compose.yml pull
docker compose -f ./test/docker-compose.yml up -d
$(MAKE) test
docker compose -f ./test/docker-compose.yml down
31 changes: 0 additions & 31 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"encoding/base64"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
Expand All @@ -23,36 +22,6 @@ import (
"github.com/chromedp/chromedp"
)

func TestMain(m *testing.M) {
log.Print("docker-compose pull ...")
cmd := exec.Command("docker-compose", "-f", "test/docker-compose.yml", "pull")
cmd.Stdout = io.Discard
err := cmd.Run()
if err != nil {
log.Fatal(err)
}

log.Print("docker-compose up ...")
cmd = exec.Command("docker-compose", "-f", "test/docker-compose.yml", "up", "-d")
cmd.Stdout = io.Discard
err = cmd.Run()
if err != nil {
log.Fatal(err)
}

code := m.Run()

log.Print("docker-compose down ...")
cmd = exec.Command("docker-compose", "-f", "test/docker-compose.yml", "down")
cmd.Stdout = io.Discard
err = cmd.Run()
if err != nil {
log.Fatal(err)
}

os.Exit(code)
}

func TestOpenIDConnectFlow(t *testing.T) {
// create new remote chrome context (tab)
allocCtx, rcancel := chromedp.NewRemoteAllocator(context.Background(), "ws://127.0.0.1:9222/")
Expand Down

0 comments on commit 7f227f1

Please sign in to comment.