-
Notifications
You must be signed in to change notification settings - Fork 23
60 lines (51 loc) · 1.89 KB
/
smoke.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Runs all ecosystems cached and concurrently.
name: Smoke
on: # yamllint disable-line rule:truthy
workflow_dispatch:
pull_request:
branches: ["main"]
schedule:
- cron: "0 * * * *"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
suites:
uses: ./.github/workflows/list-suites.yml
smoke:
runs-on: ubuntu-latest
needs: suites
strategy:
fail-fast: false
matrix:
suite: ${{ fromJSON(needs.suites.outputs.suites) }}
steps:
- uses: actions/checkout@v4
- name: Download CLI
run: |
gh release download --repo dependabot/cli -p "*linux-amd64.tar.gz"
tar xzvf *.tar.gz >/dev/null 2>&1
./dependabot --version
# Download the Proxy cache. The job is ideally 100% cached so no real calls are made.
- name: Download artifacts
run: |
set +e
script/download-cache.sh ${{ matrix.suite }}
# If the previous command failed, and this is a scheduled run, fail the job.
if [ $? -ne 0 ] && [ "${{ github.event_name }}" == "schedule" ]; then
exit 1
fi
- name: ${{ matrix.suite }}
env:
LOCAL_GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -o pipefail
./dependabot test -f=tests/smoke-${{ matrix.suite }}.yaml -o=result.yaml --timeout 20m --cache=cache 2>&1 | tee -a log.txt
- name: Diff
if: always()
continue-on-error: true
run: diff --ignore-space-change tests/smoke-${{ matrix.suite}}.yaml result.yaml && echo "Contents are identical" || exit 0
- 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.