Skip to content

Commit

Permalink
run Playwright in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
hperl committed Apr 27, 2023
1 parent 6db70a8 commit 0f061cc
Showing 1 changed file with 109 additions and 11 deletions.
120 changes: 109 additions & 11 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

test-e2e:
name: Run end-to-end tests
name: Run end-to-end Cypress tests
runs-on: ubuntu-latest
needs:
- sdk-generate
Expand Down Expand Up @@ -210,16 +210,114 @@ jobs:
NODE_UI_PATH: node-ui
REACT_UI_PATH: react-ui
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# TODO(hperl): Enable this once the React Native app uses the new SDK
# - name: "Run Playwright tests"
# run: |
# cd test/e2e
# npm run playwright
# env:
# DB: ${{ matrix.database }}
# RN_UI_PATH: react-native-ui
# NODE_UI_PATH: node-ui
# REACT_UI_PATH: react-ui
- if: failure()
uses: actions/upload-artifact@v2
with:
name: logs
path: test/e2e/*.e2e.log

test-e2e-playwright:
name: Run end-to-end Playwright tests
runs-on: ubuntu-latest
needs:
- sdk-generate
services:
postgres:
image: postgres:9.6
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: test
POSTGRES_USER: test
ports:
- 5432:5432
mysql:
image: mysql:5.7
env:
MYSQL_ROOT_PASSWORD: test
ports:
- 3306:3306
mailslurper:
image: oryd/mailslurper:latest-smtps
ports:
- 4436:4436
- 4437:4437
- 1025:1025
env:
TEST_DATABASE_POSTGRESQL: "postgres://test:test@localhost:5432/postgres?sslmode=disable"
TEST_DATABASE_MYSQL: "mysql://root:test@(localhost:3306)/mysql?parseTime=true&multiStatements=true"
TEST_DATABASE_COCKROACHDB: "cockroach://root@localhost:26257/defaultdb?sslmode=disable"
strategy:
matrix:
database: ["postgres", "cockroach", "sqlite", "mysql"]
steps:
- uses: actions/setup-node@v3
with:
node-version: 16
- run: |
docker create --name cockroach -p 26257:26257 \
cockroachdb/cockroach:v22.2.6 start-single-node --insecure
docker start cockroach
name: Start CockroachDB
- uses: ory/ci/checkout@master
with:
fetch-depth: 2
- run: |
npm ci
cd test/e2e; npm ci
npm i -g expo-cli
name: Install node deps
- run: |
sudo apt-get install -y moreutils gettext
name: Install tools
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: "1.19"

- name: Install selfservice-ui-react-native
uses: actions/checkout@v3
with:
repository: ory/kratos-selfservice-ui-react-native
path: react-native-ui
ref: hperl/app-oidc # TODO(hperl): remove once https://github.com/ory/kratos-selfservice-ui-react-native/pull/69 is merged
- run: |
cd react-native-ui
npm install
- name: Install selfservice-ui-node
uses: actions/checkout@v3
with:
repository: ory/kratos-selfservice-ui-node
path: node-ui
- run: |
cd node-ui
npm install
- name: Install selfservice-ui-react-nextjs
uses: actions/checkout@v3
with:
repository: ory/kratos-selfservice-ui-react-nextjs
path: react-ui
- run: |
cd react-ui
npm ci
- run: |
echo 'RN_UI_PATH='"$(realpath react-native-ui)" >> $GITHUB_ENV
echo 'NODE_UI_PATH='"$(realpath node-ui)" >> $GITHUB_ENV
echo 'REACT_UI_PATH='"$(realpath react-ui)" >> $GITHUB_ENV
- name: "Set up environment"
run: test/e2e/run.sh --only-setup
- name: "Run Playwright tests"
run: |
cd test/e2e
npm run playwright
env:
DB: ${{ matrix.database }}
RN_UI_PATH: react-native-ui
NODE_UI_PATH: node-ui
REACT_UI_PATH: react-ui
- if: failure()
uses: actions/upload-artifact@v2
with:
Expand Down

0 comments on commit 0f061cc

Please sign in to comment.