generated from ddev/ddev-addon-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(*): Add action for testing with github action initialization
- Loading branch information
1 parent
9d5bcc6
commit 3a8adca
Showing
1 changed file
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: tests with action | ||
on: | ||
pull_request: | ||
push: | ||
branches: [ main ] | ||
paths-ignore: | ||
- '**.md' | ||
|
||
schedule: | ||
- cron: '25 06 * * *' | ||
|
||
workflow_dispatch: | ||
inputs: | ||
debug_enabled: | ||
type: boolean | ||
description: Debug with tmate | ||
default: false | ||
|
||
permissions: | ||
contents: write | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
env: | ||
DDEV_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
jobs: | ||
tests-with-action: | ||
defaults: | ||
run: | ||
shell: bash | ||
|
||
strategy: | ||
matrix: | ||
ddev_version: [stable, HEAD] | ||
fail-fast: false | ||
|
||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: julienloizelet/ddev-add-on-test-init@main | ||
with: | ||
ddev_version: ${{ matrix.ddev_version }} | ||
|
||
- name: tmate debugging session | ||
uses: mxschmitt/action-tmate@v3 | ||
with: | ||
limit-access-to-actor: true | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
if: github.event.inputs.debug_enabled == 'true' | ||
|
||
- name: tests | ||
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' | ||
with: | ||
commit_message: "chore(*): Automated commit to keep the repository active" | ||
time_elapsed: 55 | ||
|
||
|