Skip to content

Commit

Permalink
Merge pull request #20 from lsst-epo/EPO-7251
Browse files Browse the repository at this point in the history
Epo 7251
  • Loading branch information
ericdrosas87 authored Dec 21, 2022
2 parents 4e56aa0 + a109c5b commit 401ff7f
Show file tree
Hide file tree
Showing 28 changed files with 49,138 additions and 2 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/pr-test-execution.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: 'Test Execution Validation'

on:
pull_request:
types:
- 'opened'
- 'synchronize'
- 'reopened'
- 'closed'
branches:
- '**'

jobs:
build-push-deploy:
name: 'Execute Test Cases'
runs-on: ubuntu-latest
if: ${{ (github.event.action != 'closed' == true) }}

services:
postgres:
image: postgres:13
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: craft_testing_db
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout
uses: actions/checkout@v2

# gCloud CLI setup
- name: Login to GCP
uses: google-github-actions/setup-gcloud@v0
with:
service_account_key: ${{ secrets.DEV_SA_KEY }}
project_id: skyviewer
export_default_credentials: true

# Get secrets
- name: Get env
run: gcloud secrets versions access latest --secret=craft-dam-plugin-env > ./tests/.env

# Composer install
- name: Install Composer dependencies
uses: php-actions/composer@v6
with:
php_version: "7.4"
php_extensions: zip
command: install

# Get secrets
# - name: Use gCloud command to connect to SQL proxy
# run: gcloud compute ssh db-client-1 --project=skyviewer --zone=us-central1-a -- -L 127.0.0.1:5432:10.109.176.5:5432 &

# Execute those tests
- name: Execute tests
run: |-
php vendor/bin/codecept run unit
# uses: joelwmale/codeception-action@master
# env:
# ENV_FILE: ./tests/.env
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
.DS_Store
vendor
.env
tests/_craft/storage/logs/
23 changes: 23 additions & 0 deletions codeception.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
actor: Tester
paths:
tests: tests
log: tests/_output
data: tests/_data
support: tests/_support
envs: tests/_envs
bootstrap: _bootstrap.php
params:
- tests/.env
modules:
config:
\craft\test\Craft:
configFile: "tests/_craft/config/test.php"
entryUrl: "http://my-project.test/index.php"
projectConfig: {}
migrations: []
plugins: []
cleanup: true
transaction: true
dbSetup: { clean: false, setupCraft: true }
seed: false
seed: false
11 changes: 9 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"docs": "https://github.com/lsst-epo/craft3-universal-dam-integrator/blob/main/README.md"
},
"require": {
"craftcms/cms": "^3.1.5"
"craftcms/cms": "3.7.59"
},
"autoload": {
"psr-4": {
Expand All @@ -28,5 +28,12 @@
"extra": {
"name": "Universal DAM Integrator",
"handle": "universal-dam-integrator"
},
"require-dev": {
"vlucas/phpdotenv": "^3.0",
"codeception/codeception": "^4.2.2",
"codeception/module-asserts": "^2.0",
"codeception/module-yii2": "^1.1",
"ext-zip": "^1.15"
}
}
}
Loading

0 comments on commit 401ff7f

Please sign in to comment.