Skip to content

Commit

Permalink
The GitHub Actions workflow for one specific config
Browse files Browse the repository at this point in the history
  • Loading branch information
Martijn Dirkse committed Jun 3, 2024
1 parent c1f68a4 commit aeeaec5
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 21 deletions.
43 changes: 22 additions & 21 deletions .github/workflows/no-console-warnings.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ on:
push:
branches:
- master
- testConfigsNoWarnings
pull_request:
workflow_dispatch:
jobs:
testing:
name: Cypress tests of ladybug + Frank!Framework
name: Test that Frank config has no warnings
runs-on: ubuntu-latest
steps:
- name: Checkout Frank!Runner
Expand All @@ -22,31 +23,32 @@ jobs:
run: echo "tomcat.connector.port=8090" > frank-runner/build.properties
- name: Set debug to true
run: echo "debug=true" >> frank-runner/build.properties
- name: Checkout ladybug-ff-cypress-test
- name: Set projects.dir
run: echo "projects.dir=.." >> frank-runner/build.properties
- name: Select the configuration in the manual we want to test
run: echo "project.dir=frank-manual/srcSteps/Frank2Hermes/v560" >> frank-runner/build.properties
- name: Checkout frank-manual
uses: actions/checkout@v4
with:
path: ladybug-ff-cypress-test
- name: Copy cypress.config_cicd.ts to cypress.config.ts to listen to correct port
path: frank-manual
- name: Copy cypress/cypress.config_cicd.ts to cypress/cypress.config.ts to listen to correct port
run: cp cypress.config_cicd.ts cypress.config.ts
working-directory: ladybug-ff-cypress-test
working-directory: frank-manual/cypress
- name: Use Node.js 20.x
uses: actions/setup-node@v2
with:
node-version: 20.x
cache: "yarn"
cache-dependency-path: "**/yarn.lock"
- name: Update yarn
run: corepack enable
working-directory: "ladybug-ff-cypress-test"
- name: Show node version
run: node -v
working-directory: "ladybug-ff-cypress-test"
working-directory: "frank-manual/cypress"
- name: Show yarn version
run: yarn -v
working-directory: "ladybug-ff-cypress-test"
working-directory: "frank-manual/cypress"
- name: Install packages
run: yarn install --immutable
working-directory: ladybug-ff-cypress-test
working-directory: frank-manual/cypress
- name: Cache Frank!Runner dependencies - build
uses: actions/cache@v3
with:
Expand All @@ -64,8 +66,8 @@ jobs:
- name: Show current time, allows you to check that logs are not old
run: date
- name: Let Frank!Runner do its downloads
run: yarn run installFrankRunnerEnv
working-directory: ladybug-ff-cypress-test
run: run env.sh > installFrankRunnerEnv.log
working-directory: frank-runner
- name: Show apache-tomcat directories
run: find . -path './build/*' -name 'apache-tomcat*'
working-directory: frank-runner
Expand All @@ -79,14 +81,14 @@ jobs:
run: find . -path './build/apache-tomcat*/catalina.out' -delete
working-directory: frank-runner
- name: Start server using Frank!Runner in background
run: yarn run startServer &
working-directory: ladybug-ff-cypress-test
run: ./restart.sh > serverStartLog.log &
working-directory: frank-runner
- name: Wait for server to be available
run: ./waitForUrl.sh http://localhost:8090 240
working-directory: ladybug-ff-cypress-test/.github/workflows
working-directory: frank-manual/.github/workflows
- name: Run the tests
run: yarn batch
working-directory: ladybug-ff-cypress-test
run: yarn run cypress run
working-directory: frank-manual/cypress
- name: Try to access server directly with curl
run: curl -v -i -X DELETE http://localhost:8090/iaf/ladybug/api/report/all/Test
if: always()
Expand Down Expand Up @@ -122,11 +124,10 @@ jobs:
if: always()
with:
name: screenshots
path: ladybug-ff-cypress-test/cypress/screenshots/
path: frank-manual/cypress/cypress/screenshots/
- name: Store Cypress videos
uses: actions/upload-artifact@v2
if: always()

with:
name: videos
path: ladybug-ff-cypress-test/cypress/videos/
path: frank-manual/cypress/cypress/videos/
21 changes: 21 additions & 0 deletions .github/workflows/waitForUrl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

url=$1
numTries=$2
triesSoFar=0
result=1000
while [[ ${triesSoFar} -le ${numTries} ]]; do
let triesSoFar++
curl -s ${url}
result=$?
if [[ ${result} -eq 0 ]]; then
break
else
sleep 1
fi
done
# We want to see the output of this command only once
curl ${url}
result=$?
echo "Curl return code: ${result}"
exit ${result}
10 changes: 10 additions & 0 deletions cypress/cypress.config_cicd.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
e2e: {
supportFile: 'cypress/support/e2e.ts',
setupNodeEvents(on, config) {
// implement node event listeners here
},
baseUrl: 'http://localhost:8090',
video: true
},
};

0 comments on commit aeeaec5

Please sign in to comment.