Skip to content

Commit

Permalink
feat(*): Add keepalive in action
Browse files Browse the repository at this point in the history
  • Loading branch information
julienloizelet committed Aug 11, 2023
1 parent e94110d commit 1730413
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 13 deletions.
16 changes: 4 additions & 12 deletions .github/workflows/add-on-simple-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,18 @@ jobs:
runs-on: ubuntu-20.04
env:
ADDON_GITHUB_URL: "julienloizelet/ddev-playwright"
ADDON_REF: "v2.1.1"

steps:

- name: Clone tested add-on files
uses: actions/checkout@v3
with:
repository: ${{ env.ADDON_GITHUB_URL }}
ref: ${{ env.ADDON_REF }}

- name: Clone current repository
uses: actions/checkout@v3
with:
path: action
path: ../../action

- name: Run DDEV test (${{ matrix.ddev_version }})
uses: ./action/
uses: ../../action
with:
ddev_version: ${{ matrix.ddev_version }}
token: ${{ secrets.GITHUB_TOKEN }}
debug_enabled: false


addon_repository: ${{ env.ADDON_GITHUB_URL }}
addon_ref: v2.1.1
34 changes: 33 additions & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,26 @@ inputs:
options:
- "stable"
- "HEAD"
-

addon_repository:
description: 'Repository of the tested addon'
required: true

addon_ref:
description: 'Repository ref of the tested addon'
required: true

keepalive:
type: boolean
description: 'Keeps GitHub from turning off tests after 60 days'
required: true
default: true

keepalive_time_elapsed:
description: 'Time elapsed from the previous commit to trigger a new automated commit (in days)'
required: true
default: 55

debug_enabled:
type: boolean
description: Debug with tmate
Expand All @@ -35,6 +54,11 @@ runs:
brew install bats-core mkcert
mkcert -install
- uses: actions/checkout@v3
with:
repository: ${{ inputs.addon_repository }}
ref: ${{ inputs.addon_ref }}

- name: Use ddev stable
shell: bash
if: inputs.ddev_version == 'stable'
Expand Down Expand Up @@ -62,6 +86,14 @@ runs:
shell: bash
run: bats tests

# keepalive-workflow adds a dummy commit if there's no other action here, keeps
# GitHub from turning off tests after 60 days
- uses: gautamkrishnar/keepalive-workflow@v1
if: matrix.ddev_version == 'stable' && inputs.keepalive == 'true'
with:
commit_message: "chore(*): Automated commit to keep the repository active"
time_elapsed: ${{ inputs.keepalive_time_elapsed }}

branding:
icon: "code"
color: "green"

0 comments on commit 1730413

Please sign in to comment.