Skip to content

Include the directory name in multi-directory PR summaries #10674

Include the directory name in multi-directory PR summaries

Include the directory name in multi-directory PR summaries #10674

Workflow file for this run

# Runs all ecosystems cached and concurrently.
name: Smoke
on: # yamllint disable-line rule:truthy
workflow_dispatch:
push:
branches: ["main"]
pull_request:
paths-ignore:
- docs/**
- README.md
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
e2e:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
suite:
# core - the directory name in dependabot-core for the ecosystem
# test - the test name in smoke-tests: tests/smoke-${test}.yaml
# ecosystem - the ecosystem name in the Docker image
- { core: bundler, test: bundler, ecosystem: bundler }
- { core: bundler, test: bundler-group-rules, ecosystem: bundler }
- { core: bundler, test: bundler-group-vendoring, ecosystem: bundler }
- { core: cargo, test: cargo, ecosystem: cargo }
- { core: composer, test: composer, ecosystem: composer }
- { core: docker, test: docker, ecosystem: docker }
- { core: elm, test: elm, ecosystem: elm }
- { core: git_submodules, test: submodules, ecosystem: gitsubmodule }
- { core: github_actions, test: actions, ecosystem: github-actions }
- { core: go_modules, test: go, ecosystem: gomod }
- { core: go_modules, test: go-close-pr, ecosystem: gomod }
- { core: go_modules, test: go-group-rules, ecosystem: gomod }
- { core: go_modules, test: go-security, ecosystem: gomod }
- { core: go_modules, test: go-update-pr, ecosystem: gomod }
- { core: gradle, test: gradle, ecosystem: gradle }
- { core: gradle, test: gradle-version-catalog, ecosystem: gradle }
- { core: hex, test: hex, ecosystem: mix }
- { core: maven, test: maven, ecosystem: maven }
- { core: npm_and_yarn, test: npm, ecosystem: npm }
- { core: npm_and_yarn, test: npm-group-rules, ecosystem: npm }
- { core: npm_and_yarn, test: npm-remove-transitive, ecosystem: npm }
- { core: npm_and_yarn, test: pnpm, ecosystem: npm }
- { core: npm_and_yarn, test: yarn, ecosystem: npm }
- { core: npm_and_yarn, test: yarn-berry, ecosystem: npm }
- { core: npm_and_yarn, test: yarn-berry-workspaces, ecosystem: npm }
- { core: nuget, test: nuget, ecosystem: nuget }
- { core: nuget, test: nuget-resolvability, ecosystem: nuget }
- { core: pub, test: pub, ecosystem: pub }
- { core: python, test: pip, ecosystem: pip }
- { core: python, test: pipenv, ecosystem: pip }
- { core: python, test: pip-compile, ecosystem: pip }
- { core: python, test: poetry, ecosystem: pip }
- { core: swift, test: swift, ecosystem: swift }
- { core: terraform, test: terraform, ecosystem: terraform }
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: dorny/paths-filter@v2
if: github.event_name != 'workflow_dispatch'
id: changes
with:
filters: |
common:
- .github/workflows/smoke.yml
- .dockerignore
- Dockerfile.updater-core
- 'common/**'
- 'updater/**'
github_actions:
- 'github_actions/**'
bundler:
- 'bundler/**'
cargo:
- 'cargo/**'
composer:
- 'composer/**'
docker:
- 'docker/**'
elm:
- 'elm/**'
go_modules:
- 'go_modules/**'
gradle:
- 'gradle/**'
hex:
- 'hex/**'
maven:
- 'maven/**'
npm_and_yarn:
- 'npm_and_yarn/**'
nuget:
- 'nuget/**'
python:
- 'python/**'
pub:
- 'pub/**'
git_submodules:
- 'git_submodules/**'
swift:
- 'swift/**'
terraform:
- 'terraform/**'
- name: Download CLI and test
if: steps.changes.outputs[matrix.suite.core] == 'true' || steps.changes.outputs['common'] == 'true'
run: |
gh release download --repo dependabot/cli -p "*linux-amd64.tar.gz"
tar xzvf *.tar.gz >/dev/null 2>&1
./dependabot --version
URL=https://api.github.com/repos/dependabot/smoke-tests/contents/tests/smoke-${{ matrix.suite.test }}.yaml
curl $(gh api $URL --jq .download_url) -o smoke.yaml
# Download the Proxy cache. The job is ideally 100% cached so no real calls are made.
# Allowed to fail to get out of checking and egg situations, for example, when adding a new ecosystem.
- name: Download cache
if: steps.changes.outputs[matrix.suite.core] == 'true' || steps.changes.outputs['common'] == 'true'
run: |
gh run download --repo dependabot/smoke-tests --name cache-${{ matrix.suite.test }} --dir cache
continue-on-error: true
- name: Build ecosystem image
if: steps.changes.outputs[matrix.suite.core] == 'true' || steps.changes.outputs['common'] == 'true'
run: script/build ${{ matrix.suite.core }}
- name: ${{ matrix.suite.core }}
if: steps.changes.outputs[matrix.suite.core] == 'true' || steps.changes.outputs['common'] == 'true'
id: test
env:
LOCAL_GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -o pipefail
./dependabot test \
-f=smoke.yaml \
-o=result.yaml \
--cache=cache \
--timeout=20m \
--updater-image=ghcr.io/dependabot/dependabot-updater-${{ matrix.suite.ecosystem }}:latest \
2>&1 | tee -a log.txt
- name: Diff
if: steps.test.outcome != 'skipped'
continue-on-error: true
run: diff --ignore-space-change smoke.yaml result.yaml && echo "Contents are identical"
- name: Create summary
if: steps.changes.outputs[matrix.suite.core] == 'true' || steps.changes.outputs['common'] == 'true'
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.