Skip to content

Commit eb4e865

Browse files
committed
Refactor testr.yml file for GitHub
- Do not test for md files - Remove write permissions (apparently not requried) - Remove strategy for code quailiy job because it is not really used as there is onnly one variant - Functional tests afains DEV stable and HEAD - Add support for remote SSH debugging - Use modern input approach to access inputs
1 parent 0703e3b commit eb4e865

File tree

1 file changed

+30
-13
lines changed

1 file changed

+30
-13
lines changed

.github/workflows/tests.yml

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,34 @@
11
name: tests
22
on:
33
pull_request:
4+
paths-ignore:
5+
- "**.md"
46
push:
7+
branches:
8+
- main
9+
- 'tests**'
10+
paths-ignore:
11+
- "**.md"
512

613
schedule:
7-
- cron: '00 07 * * *'
14+
- cron: '00 07 * * 0'
815

16+
# Manual trigger with optional debug using SSH.
17+
# See https://github.com/mxschmitt/action-tmate
918
workflow_dispatch:
1019
inputs:
1120
debug_enabled:
1221
type: boolean
13-
description: Debug with tmate
22+
description: Debug with tmate (SSH access)
1423
required: false
1524
default: false
1625

17-
# This is required for "gautamkrishnar/keepalive-workflow", see "ddev/github-action-add-on-test"
1826
permissions:
19-
actions: write
27+
contents: read
2028

2129
jobs:
30+
# Job for code quality checks.
2231
code_quality:
23-
strategy:
24-
matrix:
25-
ddev_version: [stable]
26-
fail-fast: false
2732
runs-on: ubuntu-latest
2833
steps:
2934
- name: "Check out code"
@@ -32,21 +37,33 @@ jobs:
3237
uses: a5k-actions/shellchecker@v0
3338
with:
3439
severity: error
40+
41+
# Actual functional tests.
3542
tests:
3643
strategy:
3744
matrix:
38-
ddev_version: [stable]
45+
ddev_version: [stable, HEAD]
3946
fail-fast: false
40-
4147
runs-on: ubuntu-latest
4248

4349
steps:
50+
# Add support for tmate debugging if requested.
51+
- name: Setup Tmate Debugging
52+
if: ${{ github.event.inputs.debug_enabled == 'true' }}
53+
uses: mxschmitt/action-tmate@v3
54+
with:
55+
# This key is usually needed to keep the connection open
56+
limit-access-to-actor: true
57+
58+
# Sets Bash in a strict fashion.
4459
- name: Action Setup Bash
4560
uses: release-engineers/action-setup-bash@v1
61+
62+
# Official DDEV action to test add-ons.
4663
- uses: ddev/github-action-add-on-test@v2
4764
with:
4865
ddev_version: ${{ matrix.ddev_version }}
4966
token: ${{ secrets.GITHUB_TOKEN }}
50-
debug_enabled: ${{ github.event.inputs.debug_enabled }}
51-
addon_repository: ${{ env.GITHUB_REPOSITORY }}
52-
addon_ref: ${{ env.GITHUB_REF }}
67+
debug_enabled: ${{ inputs.debug_enabled }}
68+
addon_repository: ${{ github.repository }}
69+
addon_ref: ${{ github.ref }}

0 commit comments

Comments
 (0)