forked from shopware/shopware
-
Notifications
You must be signed in to change notification settings - Fork 1
90 lines (84 loc) · 2.73 KB
/
nightly.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Nightly
on:
schedule:
- cron: "0 1 * * *" # every day at 01:00
workflow_dispatch:
jobs:
clean-ghcr:
name: Delete old unused container images
runs-on: ubuntu-24.04
steps:
- name: Collect skipped SHAs
id: skip-sha
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
result="skip-sha="
while read tag; do
docker_manifest=$(docker manifest inspect ghcr.io/shopware/shopware/ci-e2e:${tag} 2>&1 || true)
# If the image does not exist or an error happens
if ! jq '.' <<<"${docker_manifest}" > /dev/null 2>&1; then
echo "${tag}: ${docker_manifest}"
continue
fi
# Only collect the shas of multi-arch images
if [[ $(jq -r '.manifests | length' <<<"${docker_manifest}") -gt 0 ]]; then
result="${result}$(jq -r '.manifests[] | .digest' <<<"${docker_manifest}" | paste -s -d ',' -),"
fi
done<<<$(gh api '/orgs/shopware/packages/container/shopware%2Fci-e2e/versions?per_page=100' --jq '.[] | .metadata.container.tags[] | select(. == "latest" or . == "trunk" or . == "6.5.x" or startswith("v"))')
echo "${result}" >> "${GITHUB_OUTPUT}"
- name: Delete old images
uses: snok/[email protected]
with:
account: shopware
token: ${{ github.token }}
cut-off: 2d
image-names: ${{ github.event.repository.name }}/ci-e2e
image-tags: "!latest, !trunk, !6.5.x, !v*"
skip-shas: ${{ steps.skip-sha.outputs.skip-sha }}
keep-n-most-recent: 1
dry-run: ${{ env.ACT && true || false }}
redis:
name: Redis
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
redis:
- redis:alpine
- eqalpha/keydb:latest
- valkey/valkey:8.0
services:
redis:
image: ${{ matrix.redis }}
ports:
- "6379:6379"
env:
REDIS_URL: redis://localhost:6379
COMPOSER_ROOT_VERSION: 6.6.9999999-dev
steps:
- name: Setup Shopware
uses: shopware/setup-shopware@main
with:
shopware-version: ${{ github.ref }}
shopware-repository: ${{ github.repository }}
- name: Run PHPUnit
run: |
./vendor/bin/phpunit --group=redis
admin:
uses: ./.github/workflows/admin.yml
secrets: inherit
integration:
uses: ./.github/workflows/integration.yml
secrets: inherit
php:
uses: ./.github/workflows/php.yml
secrets: inherit
storefront:
uses: ./.github/workflows/storefront.yml
secrets: inherit
downstream:
uses: ./.github/workflows/downstream.yml
secrets: inherit
with:
nightly: true