diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3d01611..ab84376 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -64,8 +64,8 @@ jobs: - name: Start Open VPN 3 run: openvpn3 session-start --config .github/vpn/config.ovpn - - name: install sasjs/cli - run: npm i -g @sasjs/cli + - name: install pm2 + run: npm i -g pm2 - name: Deploy sasjs-tests run: | @@ -77,17 +77,16 @@ jobs: replace-in-files --regex='"userName".*' --replacement='"userName":"${{ secrets.SASJS_USERNAME }}",' ./public/config.json replace-in-files --regex='"password".*' --replacement='"password":"${{ secrets.SASJS_PASSWORD }}",' ./public/config.json replace-in-files --regex='"serverType".*' --replacement='"serverType":"SASJS",' ./public/config.json - npm run update:adapter && npm run build - echo "CLIENT=${{secrets.SAS9_4GL_IO_CLIENT}}"> .env.4gl - echo "ACCESS_TOKEN=${{secrets.SAS9_4GL_IO_ACCESS_TOKEN}}" >> .env.4gl - echo "REFRESH_TOKEN=${{secrets.SAS9_4GL_IO_REFRESH_TOKEN}}" >> .env.4gl - sasjs cbd -t 4gl + cat ./public/config.json + npm run update:adapter + pm2 start --name sasjs-test npm -- start - name: Run cypress on sasjs run: | - replace-in-files --regex='"sasjsTestsUrl".*' --replacement='"sasjsTestsUrl":"${{ secrets.SASJS_TEST_URL }}",' ./cypress.json + replace-in-files --regex='"sasjsTestsUrl".*' --replacement='"sasjsTestsUrl":"http://localhost:3000",' ./cypress.json replace-in-files --regex='"username".*' --replacement='"username":"${{ secrets.SASJS_USERNAME }}",' ./cypress.json replace-in-files --regex='"password".*' --replacement='"password":"${{ secrets.SASJS_PASSWORD }}",' ./cypress.json + cat ./cypress.json sh ./sasjs-tests/sasjs-cypress-run.sh ${{ secrets.MATRIX_TOKEN }} https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} # For some reason if coverage report action is run before other commands, those commands can't access the directories and files on which they depend on diff --git a/sasjs-tests/sasjs-cypress-run.sh b/sasjs-tests/sasjs-cypress-run.sh index 6c9ab4e..ceeb4fc 100755 --- a/sasjs-tests/sasjs-cypress-run.sh +++ b/sasjs-tests/sasjs-cypress-run.sh @@ -1,6 +1,6 @@ #!/bin/bash -if npm run cypress ; then +if npm run cy:run -- --spec "cypress/integration/sasjs.tests.ts" ; then echo "Cypress sasjs testing passed!" else echo '{"msgtype":"m.text", "body":"Automated sasjs-tests failed on the @sasjs/adapter PR: '$2'"}'