-
Notifications
You must be signed in to change notification settings - Fork 204
76 lines (73 loc) · 3.26 KB
/
trigger.yaml
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
name: Auto trigger on push or pull requests
on:
pull_request: {}
push: {}
jobs:
build_testplan:
runs-on: 'ubuntu-latest'
outputs:
testplan: '${{ steps.build.outputs.testplan }}'
steps:
- name: 'Build testplan'
id: build
run: |
# Build testplan
if [ '${{ github.event_name }}' == 'pull_request' ]; then
REF_TO_CHECK='refs/heads/${{ github.base_ref }}'
LIMIT70=""
LIMIT=""
else
REF_TO_CHECK='${{ github.ref }}'
# shellcheck disable=SC2088
LIMIT70="~/defaults/php8.1_mysql5.7_only.yaml,"
# shellcheck disable=SC2088
LIMIT="~/defaults/php8.2_mysql5.7_only.yaml,"
fi
# shellcheck disable=SC2088
case "${REF_TO_CHECK}" in
refs/heads/b-7.0.x*) TESTPLAN="~/defaults/7.0.x.yaml,${LIMIT70}~/shop_ce.yaml" ;;
refs/heads/b-7.1.x*) TESTPLAN="~/defaults/7.1.x.yaml,${LIMIT}~/shop_ce.yaml" ;;
refs/heads/b-7.2.x*) TESTPLAN="~/defaults/7.2.x.yaml,${LIMIT}~/shop_ce.yaml" ;;
refs/heads/b-7.3.x*) TESTPLAN="~/defaults/7.3.x.yaml,${LIMIT}~/shop_ce.yaml" ;;
refs/heads/b-8.0.x*) TESTPLAN="${LIMIT}~/shop_ce.yaml" ;;
*)
echo "Can't match ${REF_TO_CHECK} to a version, can't determine test plan."
echo "Branch names should start with b-<major>.<minor>.x"
echo "Using the shop changelog to determine the shop version"
git clone --depth 2 "${{ github.repositoryUrl }}" --branch "${{ github.ref_name}}" --single-branch .tmp
if [ -f .tmp/CHANGELOG-8.0 ]; then
TESTPLAN="${LIMIT}~/shop_ce.yaml"
elif [ -f .tmp/CHANGELOG-7.3 ]; then
TESTPLAN="~/defaults/7.3.x.yaml,${LIMIT}~/shop_ce.yaml"
elif [ -f .tmp/CHANGELOG-7.2 ]; then
TESTPLAN="~/defaults/7.2.x.yaml,${LIMIT}~/shop_ce.yaml"
elif [ -f .tmp/CHANGELOG-7.1 ]; then
TESTPLAN="~/defaults/7.1.x.yaml,${LIMIT}~/shop_ce.yaml"
elif [ -f .tmp/CHANGELOG-7.0 ]; then
TESTPLAN="~/defaults/7.0.x.yaml,${LIMIT70}~/shop_ce.yaml"
else
echo "Could not find any of CHANGELOG-8.0, CHANGELOG-7.3, CHANGELOG-7.2, CHANGELOG-71. or CHANGELOG-7.0"
echo "Still can't determine the test plan"
exit 1
fi
rm -rf .tmp
;;
esac
echo "testplan=${TESTPLAN}" | tee -a "${GITHUB_OUTPUT}"
shop_ce:
needs: build_testplan
uses: oxid-eSales/github-actions/.github/workflows/universal_workflow_light.yaml@v4
with:
testplan: ${{ needs.build_testplan.outputs.testplan }}
runs_on: '"ubuntu-latest"'
defaults: 'v4'
plan_folder: '.github/oxid-esales'
secrets:
DOCKER_HUB_USER: ${{ secrets.DOCKER_HUB_USER }}
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }}
CACHE_ENDPOINT: ${{ secrets.CACHE_ENDPOINT }}
CACHE_ACCESS_KEY: ${{ secrets.CACHE_ACCESS_KEY }}
CACHE_SECRET_KEY: ${{ secrets.CACHE_SECRET_KEY }}
enterprise_github_token: ${{ secrets.enterprise_github_token }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}