Skip to content

Commit

Permalink
Split test into build-and-test and e2e-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinwy committed May 22, 2024
1 parent 43acf70 commit 7167fc5
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
name: test
name: Build Workflow

on:
- push
- pull_request

push:
branches:
- main
pull_request:
branches:
- '*'

jobs:
cypress-tests:
Expand All @@ -24,6 +27,7 @@ jobs:
with:
name: screenshots
path: tests/cypress/screenshots/

build:
runs-on: ubuntu-latest
steps:
Expand All @@ -34,27 +38,4 @@ jobs:
with:
name: komoju-japanese-payments
path: komoju-japanese-payments.zip
retention-days: 1
e2e-tests:
runs-on: ubuntu-latest
needs: [build]
env:
TARGET: staging
WAF_STAGING_TOKEN: ${{ secrets.WAF_STAGING_TOKEN }}
steps:
- uses: actions/checkout@v3
with:
repository: 'degica/komoju-e2e-tests'
submodules: recursive
token: ${{ secrets.BUNDLER_SSH_KEY }}
- uses: actions/download-artifact@v3
with:
name: komoju-japanese-payments
- name: Show files
run: ls
- name: Set up docker-compose
run: |-
docker-compose build
docker-compose up -d
- name: Run e2e tests
run: docker-compose run tester rspec spec/woocommerce
retention-days: 1
41 changes: 41 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: E2E Tests Workflow

on:
pull_request_target:
branches:
- main
workflow_run:
workflows: ["Build and Test"]
types:
- completed

jobs:
e2e-tests:
runs-on: ubuntu-latest

env:
TARGET: staging
WAF_STAGING_TOKEN: ${{ secrets.WAF_STAGING_TOKEN }}

steps:
- uses: actions/checkout@v3
with:
repository: 'degica/komoju-e2e-tests'
submodules: recursive
token: ${{ secrets.BUNDLER_SSH_KEY }}

- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: komoju-japanese-payments

- name: Show files
run: ls

- name: Set up docker-compose
run: |-
docker-compose build
docker-compose up -d
- name: Run e2e tests
run: docker-compose run tester rspec spec/woocommerce

0 comments on commit 7167fc5

Please sign in to comment.