Skip to content

Migrate pub handler to OIDCRegistry #143

Migrate pub handler to OIDCRegistry

Migrate pub handler to OIDCRegistry #143

Workflow file for this run

# Runs all ecosystems cached and concurrently.
name: Smoke
permissions:
contents: read
on: # yamllint disable-line rule:truthy
workflow_dispatch:
pull_request:
branches: ["main"]
paths-ignore:
- docs/**
- README.md
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
suites:
runs-on: ubuntu-latest
steps:
- id: gather
run: |
URL="https://api.github.com/repos/dependabot/smoke-tests/contents/tests"
DATA="$(gh api $URL | jq -r '.[].name' | sed 's/smoke-//' | sed 's/.yaml$//' | jq -R | jq -sc)"
echo "suite=$DATA" >> $GITHUB_OUTPUT
outputs:
suites: ${{ steps.gather.outputs.suite }}
e2e:
runs-on: ubuntu-latest
needs: suites
strategy:
fail-fast: false
matrix:
suite: ${{ fromJSON(needs.suites.outputs.suites) }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Install Go
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version-file: go.mod
- name: Install Dependabot CLI
run: go install github.com/dependabot/cli/cmd/dependabot@latest
- name: Download smoke test
env:
SUITE: ${{ matrix.suite }}
run: |
gh api "repos/dependabot/smoke-tests/contents/tests/smoke-${SUITE}.yaml" -H "Accept: application/vnd.github.raw" > smoke.yaml
# Download the Proxy cache. The job is ideally 100% cached so no real calls are made.
- name: Download cache
env:
SUITE: ${{ matrix.suite }}
run: |
gh run download --repo dependabot/smoke-tests --name "cache-${SUITE}" --dir cache
- name: Build proxy image
run: docker build -t "dependabot/proxy:latest" .
- name: ${{ matrix.suite }}
env:
LOCAL_GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -o pipefail
dependabot test \
-f=smoke.yaml \
-o=result.yaml \
--cache=cache \
--timeout=20m \
--proxy-image=dependabot/proxy:latest \
2>&1 | tee -a log.txt
- name: Diff
if: always()
continue-on-error: true
run: diff --ignore-space-change smoke.yaml result.yaml && echo "Contents are identical"
- name: Create summary
run: tail -n100 log.txt | grep -P '\d+/\d+ calls cached \(\d+%\)' >> $GITHUB_STEP_SUMMARY
# No upload at the end:
# - If a test is uncachable in some regard, the cache would grow unbound.
# - We might want to consider erroring if the cache is changed.