E2E CoreDNS workflow (oryxlabs/PolarDNS)
The E2E CoreDNS workflow from oryxlabs/PolarDNS, explained and optimized by Latchkey.
CI health: B - good
Run this on Latchkey for self-healing, caching, and up to 58% lower cost.
Grade your own workflow free or run it on Latchkey →What it does
This is the E2E CoreDNS workflow from the oryxlabs/PolarDNS repository, a real project running GitHub Actions. It is shown here with attribution under its Apache-2.0 license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
name: E2E CoreDNS
on:
- workflow_dispatch
jobs:
tests:
runs-on: [linux, self-hosted]
strategy:
matrix:
version:
- "1.12.0"
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.DEV_AWS_ECR_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.DEV_AWS_ECR_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.DEV_AWS_ECR_REGION }}
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- uses: actions/checkout@v4
- name: Run CoreDNS
run: |
docker run --name coredns -p 10053:53/udp -p 10053:53/tcp -d -v "${{ github.workspace }}/.github/workflows/e2e-coredns/Corefile:/Corefile" coredns/coredns:${{ matrix.version }}
sleep 10
- name: Run PolarDNS
uses: ./.github/actions/run-polardns
with:
resolver: coredns
- name: Run E2E tests
uses: ./.github/actions/e2e-tests
continue-on-error: true
- name: Collect Docker logs
run: |
mkdir -p test-e2e/debug
docker ps -a >test-e2e/debug/docker.log 2>&1
- name: Collect CoreDNS logs
run: |
docker logs coredns >test-e2e/debug/coredns.log 2>&1
- name: Collect PolarDNS logs
run: |
docker logs polardns >test-e2e/debug/polardns.log 2>&1
- name: Compress test results
run: tar -czf test-e2e-results-coredns-${{ matrix.version }}.tar.gz -C test-e2e .
- name: Upload test results
uses: actions/upload-artifact@v3
with:
path: test-e2e-results-coredns-${{ matrix.version }}.tar.gz
name: test-e2e-results-coredns-${{ matrix.version }}
if-no-files-found: ignore
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
name: E2E CoreDNS on: - workflow_dispatch jobs: tests: timeout-minutes: 30 runs-on: [linux, self-hosted] strategy: matrix: version: - "1.12.0" steps: - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 with: aws-access-key-id: ${{ secrets.DEV_AWS_ECR_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.DEV_AWS_ECR_SECRET_ACCESS_KEY }} aws-region: ${{ secrets.DEV_AWS_ECR_REGION }} - name: Login to Amazon ECR id: login-ecr uses: aws-actions/amazon-ecr-login@v1 - uses: actions/checkout@v4 - name: Run CoreDNS run: | docker run --name coredns -p 10053:53/udp -p 10053:53/tcp -d -v "${{ github.workspace }}/.github/workflows/e2e-coredns/Corefile:/Corefile" coredns/coredns:${{ matrix.version }} sleep 10 - name: Run PolarDNS uses: ./.github/actions/run-polardns with: resolver: coredns - name: Run E2E tests uses: ./.github/actions/e2e-tests continue-on-error: true - name: Collect Docker logs run: | mkdir -p test-e2e/debug docker ps -a >test-e2e/debug/docker.log 2>&1 - name: Collect CoreDNS logs run: | docker logs coredns >test-e2e/debug/coredns.log 2>&1 - name: Collect PolarDNS logs run: | docker logs polardns >test-e2e/debug/polardns.log 2>&1 - name: Compress test results run: tar -czf test-e2e-results-coredns-${{ matrix.version }}.tar.gz -C test-e2e . - name: Upload test results uses: actions/upload-artifact@v3 with: path: test-e2e-results-coredns-${{ matrix.version }}.tar.gz name: test-e2e-results-coredns-${{ matrix.version }} if-no-files-found: ignore
What changed
- Add a job timeout so a hung step cannot burn hours of runner time.
2 third-party actions are referenced by a movable tag. Pin them to the commit SHA (Latchkey resolves and applies this automatically) so a repointed tag cannot change what runs.
What Latchkey heals here
This workflow has steps that commonly fail on transient issues (network, registries, flaky browsers). On Latchkey managed runners they are detected, retried, and self-healed instead of failing your build:
- End-to-end and browser tests
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.