Skip to content

Commit

Permalink
[core] add goss
Browse files Browse the repository at this point in the history
  • Loading branch information
devlikepro committed Sep 13, 2024
1 parent 5ce4b5a commit 74a25a1
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 2 deletions.
41 changes: 39 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release
on:
push:
branches:
- "smoke-tests"
- 'smoke-tests'
tags:
- '*'

Expand All @@ -19,36 +19,42 @@ jobs:
tag: 'latest'
platform: 'amd64'
browser: 'chromium'
goss: 'goss-linux-amd64'

# Chromium - ARM
- runner: 'buildjet-4vcpu-ubuntu-2204-arm'
tag: 'arm'
platform: 'linux/arm64'
browser: 'chromium'
goss: 'goss-linux-arm'

# Chrome - x86
- runner: 'buildjet-4vcpu-ubuntu-2204'
tag: 'chrome'
platform: 'amd64'
browser: 'chrome'
goss: 'goss-linux-amd64'

# Chrome - ARM (Chrome is not available for ARM)
#- runner: "buildjet-4vcpu-ubuntu-2204-arm"
# tag: "chrome-arm"
# platform: "linux/arm64"
# browser: "chrome"
# goss: 'goss-linux-arm'

# No browser - x86
- runner: 'buildjet-4vcpu-ubuntu-2204'
tag: 'noweb'
platform: 'amd64'
browser: 'none'
goss: 'goss-linux-amd64'

# No browser - ARM
- runner: 'buildjet-4vcpu-ubuntu-2204-arm'
tag: 'noweb-arm'
platform: 'linux/arm64'
browser: 'none'
goss: 'goss-linux-arm'

steps:
- name: Checkout
Expand All @@ -73,7 +79,38 @@ jobs:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Build and push
- name: Build
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile
platforms: ${{ matrix.platform }}
build-args: |
USE_BROWSER=${{ matrix.browser }}
push: false
load: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Install goss
env:
GOSS_DOWNLOAD: 'https://github.com/goss-org/goss/releases/download'
GOSS_VERSION: 'v0.4.8'
run: |
curl -L https://github.com/goss-org/goss/releases/download/${{ env.GOSS_VERSION }}/${{ matrix.goss }} -o /usr/local/bin/goss
chmod +rx /usr/local/bin/goss
- name: Run smoke tests
working-directory: tests/smoke
timeout-minutes: 2
run: |
export GOSS_PATH=/usr/local/bin/goss
docker run -d --name smoke --rm -p3000:3000 ${{ vars.DOCKER_IMAGE }}:${{ matrix.tag }}
goss validate --retry-timeout 30s --sleep 1s
docker rm --force smoke
- name: Push
uses: docker/build-push-action@v4
with:
context: .
Expand Down
7 changes: 7 additions & 0 deletions tests/smoke/goss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
http:
http://localhost:3000/api/server/version/:
status: 200
allow-insecure: true
no-follow-redirects: true
timeout: 5000
body: ['version']
5 changes: 5 additions & 0 deletions tests/smoke/goss_wait.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
port:
tcp:3000:
listening: true
ip:
- 127.0.0.1

0 comments on commit 74a25a1

Please sign in to comment.