50 lines
1.5 KiB
YAML
50 lines
1.5 KiB
YAML
name: Test
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
schedule:
|
|
- cron: '23 4 * * 1'
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: coredns-web-ui-test
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
persist-credentials: false
|
|
- name: Format, vet, staticcheck and race tests
|
|
run: |
|
|
set -eu
|
|
docker build --pull --target test --output type=cacheonly -f dockerfile .
|
|
- name: Integration tests against MySQL
|
|
run: |
|
|
set -eu
|
|
IT_ID="${GITHUB_RUN_ID}" scripts/integration.sh
|
|
- name: Image and end-to-end tests
|
|
run: |
|
|
set -eu
|
|
commit=${GITHUB_SHA:0:12}
|
|
version="0.0.0-main.${commit}"
|
|
image="coredns-web-ui:test-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT:-1}"
|
|
if docker image inspect "$image" >/dev/null 2>&1; then
|
|
echo "::error::local image tag already exists: $image" >&2
|
|
exit 1
|
|
fi
|
|
docker build --build-arg APP_VERSION="$version" --build-arg COMMIT_ID="$commit" -f dockerfile -t "$image" .
|
|
trap 'docker image rm "$image" >/dev/null' EXIT
|
|
scripts/test-image.sh "$image" "$version" "$commit"
|
|
scripts/test-e2e.sh "$image"
|
|
- name: Save accessibility screenshots
|
|
if: always()
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: accessibility-screenshots
|
|
path: e2e/reports/**/screenshots/*.png
|
|
if-no-files-found: warn
|