-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
83 additions
and
1 deletion.
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,43 @@ | ||
name: tests | ||
on: | ||
pull_request: | ||
push: | ||
branches: [ main ] | ||
|
||
schedule: | ||
- cron: '00 07 * * *' | ||
|
||
workflow_dispatch: | ||
inputs: | ||
debug_enabled: | ||
type: boolean | ||
description: Debug with tmate | ||
required: false | ||
default: false | ||
|
||
# This is required for "gautamkrishnar/keepalive-workflow", see "ddev/github-action-add-on-test" | ||
permissions: | ||
actions: write | ||
|
||
jobs: | ||
tests: | ||
strategy: | ||
matrix: | ||
ddev_version: [stable, HEAD] | ||
fail-fast: false | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Run ShellCheck | ||
uses: azohra/shell-linter@latest | ||
with: | ||
path: "scripts,commands" | ||
|
||
- uses: ddev/github-action-add-on-test@v2 | ||
with: | ||
ddev_version: ${{ matrix.ddev_version }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
debug_enabled: ${{ github.event.inputs.debug_enabled }} | ||
addon_repository: ${{ env.GITHUB_REPOSITORY }} | ||
addon_ref: ${{ env.GITHUB_REF }} |
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
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,40 @@ | ||
setup() { | ||
set -eu -o pipefail | ||
export DIR="$( cd "$( dirname "$BATS_TEST_FILENAME" )" >/dev/null 2>&1 && pwd )/.." | ||
export TESTDIR=~/tmp/test-addon-backstopjs | ||
mkdir -p $TESTDIR | ||
export PROJNAME=test-addon-backstopjs | ||
export DDEV_NON_INTERACTIVE=true | ||
ddev delete -Oy ${PROJNAME} >/dev/null 2>&1 || true | ||
cd "${TESTDIR}" | ||
ddev config --project-name=${PROJNAME} | ||
ddev start -y >/dev/null | ||
} | ||
|
||
teardown() { | ||
set -eu -o pipefail | ||
cd ${TESTDIR} || ( printf "unable to cd to ${TESTDIR}\n" && exit 1 ) | ||
ddev delete -Oy ${PROJNAME} >/dev/null 2>&1 | ||
[ "${TESTDIR}" != "" ] && rm -rf ${TESTDIR} | ||
} | ||
|
||
@test "install from directory" { | ||
set -eu -o pipefail | ||
cd ${TESTDIR} | ||
echo "# ddev get ${DIR} with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3 | ||
ddev get ${DIR} | ||
ddev restart | ||
|
||
ddev aljibe-assistant --auto | ||
|
||
} | ||
|
||
@test "install from release" { | ||
set -eu -o pipefail | ||
cd ${TESTDIR} || ( printf "unable to cd to ${TESTDIR}\n" && exit 1 ) | ||
echo "# ddev get drud/ddev-addon-template with project ${PROJNAME} in ${TESTDIR} ($(pwd))" >&3 | ||
ddev get drud/ddev-addon-template | ||
ddev restart >/dev/null | ||
# Do something useful here that verifies the add-on | ||
# ddev exec "curl -s elasticsearch:9200" | grep "${PROJNAME}-elasticsearch" | ||
} |
Empty file.