-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
be2c473
commit 95a851d
Showing
5 changed files
with
93 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,73 @@ | ||
name: Cypress Tests | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
cypress-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Initialize Chef Habitat artifacts cache directory | ||
run: | | ||
sudo mkdir -p /hab/cache/artifacts | ||
sudo chown runner:docker -R /hab | ||
- name: Cache Chef Habitat artifacts | ||
uses: actions/cache@v1 | ||
with: | ||
path: /hab/cache/artifacts | ||
key: hab-cache-artifacts | ||
- uses: actions/checkout@v2 | ||
# TODO: wrap the next three steps an an emergence-studio action | ||
- name: 'Stop default mysql service' | ||
run: sudo service mysql stop | ||
- name: 'Initialize Chef Habitat environment' | ||
uses: JarvusInnovations/habitat-action@master | ||
env: | ||
HAB_LICENSE: accept | ||
HAB_NGINX: | | ||
[http.listen] | ||
port = 7080 | ||
HAB_MYSQL: | | ||
app_username = 'appadmin' | ||
app_password = 'appadmin' | ||
bind = '0.0.0.0' | ||
HAB_PHP_RUNTIME: | | ||
[sites.default.holo] | ||
gitDir = '${{ github.workspace }}/.git' | ||
with: | ||
deps: | | ||
jarvus/hologit | ||
supervisor: | | ||
core/mysql | ||
emergence/php-runtime --bind="database:mysql.default" | ||
emergence/nginx --bind="backend:php-runtime.default" | ||
- name: Load site projection into emergence runtime | ||
env: | ||
HOLO_CACHE_FROM: origin | ||
HOLO_CACHE_TO: origin | ||
run: | | ||
until sudo test -f /hab/svc/php-runtime/config/fpm-exec; do sleep .1; done | ||
SITE_TREE="$(hab pkg exec jarvus/hologit git-holo project emergence-site)" | ||
[ -n "${SITE_TREE}" ] || exit 1 | ||
sudo hab pkg exec emergence/php-runtime emergence-php-load "${SITE_TREE}" | ||
sudo chown runner:docker -R /hab/cache/artifacts | ||
- name: Set up Cypress workspace | ||
run: | | ||
CYPRESS_TREE="$(hab pkg exec jarvus/hologit git-holo project cypress-workspace)" | ||
[ -n "${CYPRESS_TREE}" ] || exit 1 | ||
mkdir "${GITHUB_WORKSPACE}.cypress-workspace" | ||
git archive --format=tar "${CYPRESS_TREE}" | (cd "${GITHUB_WORKSPACE}.cypress-workspace" && tar xf -) | ||
- name: Run Cypress tests | ||
uses: cypress-io/github-action@v1 | ||
with: | ||
env: STUDIO_CONTAINER=,STUDIO_SSH= | ||
working-directory: ${{ github.workspace }}.cypress-workspace | ||
- uses: actions/upload-artifact@v1 | ||
if: failure() | ||
with: | ||
name: cypress-screenshots | ||
path: ${{ github.workspace }}.cypress-workspace/cypress/screenshots | ||
- uses: actions/upload-artifact@v1 | ||
if: always() | ||
with: | ||
name: cypress-videos | ||
path: ${{ github.workspace }}.cypress-workspace/cypress/videos |
3 changes: 3 additions & 0 deletions
3
.holo/branches/cypress-workspace/_scienceleadership-skeleton.toml
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,3 @@ | ||
[holomapping] | ||
files = "cypress/**" | ||
after = "*" |
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,11 @@ | ||
[holomapping] | ||
files = [ | ||
"package.json", | ||
"package-lock.json", | ||
"cypress.json", | ||
"cypress/**", | ||
|
||
# ignore fixtures submodule | ||
"!cypress/fixtures/database" | ||
] | ||
before = "*" |
3 changes: 3 additions & 0 deletions
3
.holo/branches/cypress-workspace/cypress/fixtures/database.toml
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,3 @@ | ||
[holomapping] | ||
holosource = "slate-fixtures" | ||
files = "*.sql" |
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,3 @@ | ||
[holosource] | ||
url = "https://github.com/SlateFoundation/slate-fixtures.git" | ||
ref = "refs/heads/cbl/demo" |