mirror of
https://github.com/quay/quay.git
synced 2026-01-26 06:21:37 +03:00
107 lines
2.9 KiB
YAML
107 lines
2.9 KiB
YAML
name: Config Tool
|
|
on:
|
|
push:
|
|
branches:
|
|
- "!dependabot/*"
|
|
- "*"
|
|
paths:
|
|
- config-tool/**
|
|
pull_request:
|
|
branches:
|
|
- "*"
|
|
paths:
|
|
- config-tool/**
|
|
jobs:
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v4
|
|
with:
|
|
go-version-file: config-tool/go.mod
|
|
cache-dependency-path: config-tool/go.sum
|
|
|
|
- name: Verify go.mod
|
|
run: cd ./config-tool && go mod tidy && git diff --exit-code
|
|
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up Go 1.x
|
|
uses: actions/setup-go@v4
|
|
with:
|
|
go-version-file: config-tool/go.mod
|
|
cache-dependency-path: config-tool/go.sum
|
|
|
|
- name: Build
|
|
run: cd ./config-tool && go build -v ./...
|
|
|
|
tests:
|
|
name: Tests
|
|
runs-on: ubuntu-latest
|
|
container: docker.io/library/golang:1.24.8
|
|
services:
|
|
postgres:
|
|
image: postgres:11.5
|
|
env:
|
|
POSTGRES_USER: "user"
|
|
POSTGRES_PASSWORD: "password"
|
|
POSTGRES_DB: "quay"
|
|
redis:
|
|
image: redis:latest
|
|
mysql:
|
|
image: mysql:5.7
|
|
env:
|
|
MYSQL_ROOT_PASSWORD: password
|
|
MYSQL_DATABASE: quay
|
|
ports:
|
|
- 3306:3306
|
|
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- name: Workaround for dubious ownership issue
|
|
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
- name: Build
|
|
run: cd ./config-tool && go build -v ./...
|
|
- name: Tests
|
|
run: cd ./config-tool && go test ./pkg/lib/fieldgroups/...
|
|
env:
|
|
GODEBUG: x509ignoreCN=0
|
|
|
|
cypress:
|
|
name: Cypress
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
- name: Docker Build
|
|
run: cd config-tool && docker build -t localhost/config-tool:latest .
|
|
- name: Cypress run
|
|
uses: cypress-io/github-action@v5
|
|
with:
|
|
browser: chrome
|
|
start: docker run --rm -p 8080:8080 -v ${{ github.workspace }}/config-tool/pkg/lib/editor/cypress/conf:/conf localhost/config-tool:latest editor --config-dir /conf --password qwerty
|
|
wait-on: 'http://localhost:8080'
|
|
wait-on-timeout: 120
|
|
working-directory: config-tool/pkg/lib/editor
|
|
- name: Upload screenshots and videos
|
|
uses: actions/upload-artifact@v4
|
|
if: success() || failure()
|
|
with:
|
|
name: cypress-artifacts
|
|
path: |
|
|
config-tool/pkg/lib/editor/cypress/screenshots
|
|
config-tool/pkg/lib/editor/cypress/videos
|
|
if-no-files-found: ignore
|