diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c2cabf8..9da1d66 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,7 +4,6 @@ name: SASjs Build on: - push: pull_request: jobs: @@ -93,4 +92,4 @@ jobs: replace-in-files --regex='"sasjsTestsUrl".*' --replacement='"sasjsTestsUrl":"${{ secrets.SASJS_TEST_URL_VIYA }}",' ./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 - sh ./sasjs-cypress-run.sh ${{ secrets.SLACK_WEBHOOK }} + sh ./sasjs-cypress-run.sh ${{ secrets.DISCORD_WEBHOOK }} https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml index 20c78ad..0d405de 100644 --- a/.github/workflows/npmpublish.yml +++ b/.github/workflows/npmpublish.yml @@ -23,56 +23,6 @@ jobs: - name: Build Project run: npm run build - - - name: Install SSH Key - uses: shimataro/ssh-key-action@v2 - with: - key: ${{ secrets.DCGITLAB_KEY }} - known_hosts: 'placeholder' - - - name: Write VPN Files - run: | - echo "$CA_CRT" > .github/vpn/ca.crt - echo "$USER_CRT" > .github/vpn/user.crt - echo "$USER_KEY" > .github/vpn/user.key - echo "$TLS_KEY" > .github/vpn/tls.key - shell: bash - env: - CA_CRT: ${{ secrets.CA_CRT}} - USER_CRT: ${{ secrets.USER_CRT }} - USER_KEY: ${{ secrets.USER_KEY }} - TLS_KEY: ${{ secrets.TLS_KEY }} - - - name: Install Open VPN - run: | - sudo apt install apt-transport-https - sudo wget https://swupdate.openvpn.net/repos/openvpn-repo-pkg-key.pub - sudo apt-key add openvpn-repo-pkg-key.pub - sudo wget -O /etc/apt/sources.list.d/openvpn3.list https://swupdate.openvpn.net/community/openvpn3/repos/openvpn3-focal.list - sudo apt update - sudo apt install openvpn3 - - - name: Start Open VPN 3 - run: openvpn3 session-start --config .github/vpn/config.ovpn - - - name: Deploy sasjs-tests - run: | - npm install -g replace-in-files-cli - cd sasjs-tests - replace-in-files --regex='"@sasjs/adapter".*' --replacement='"@sasjs/adapter":"latest",' ./package.json - npm i - replace-in-files --regex='"userName".*' --replacement='"userName":"${{ secrets.SAS_USERNAME }}",' ./public/config.json - replace-in-files --regex='"password".*' --replacement='"password":"${{ secrets.SAS_PASSWORD }}",' ./public/config.json - replace-in-files --regex='"serverType".*' --replacement='"serverType":"SASJS",' ./public/config.json - npm run update:adapter && npm run build - scp -o stricthostkeychecking=no -r ./build/* ${{ secrets.DCGITLAB_DEPLOY_PATH_VIYA }} - - - name: Run cypress on sasjs - run: | - replace-in-files --regex='"sasjsTestsUrl".*' --replacement='"sasjsTestsUrl":"${{ secrets.SASJS_TEST_URL_VIYA }}",' ./cypress.json - replace-in-files --regex='"username".*' --replacement='"username":"${{ secrets.SAS_USERNAME }}",' ./cypress.json - replace-in-files --regex='"password".*' --replacement='"password":"${{ secrets.SAS_PASSWORD }}",' ./cypress.json - sh ./sasjs-cypress-run.sh ${{ secrets.SLACK_WEBHOOK }} - name: Semantic Release uses: cycjimmy/semantic-release-action@v2 diff --git a/sasjs-cypress-run.sh b/sasjs-cypress-run.sh index cb94618..ff09a49 100755 --- a/sasjs-cypress-run.sh +++ b/sasjs-cypress-run.sh @@ -3,7 +3,7 @@ if npm run cy:run -- --spec "cypress/integration/sasjs.tests.ts" ; then echo "Cypress sasjs testing passed!" else - curl -X POST --header "Content-Type:application/json" --data '{"username":"GitHub CI - Adapter SASJS-TESTS (FAIL)", "content":"Publish of a @sasjs/adapter has been canceled because of the failing sasjs-tests!", "avatar_url":"https://i.ibb.co/Lpk7Xvq/error-outline.png"}' https://discord.com/api/webhooks/969275140087111690/NGowOKrzk-ejP4gkOB-N4-cCPoWFPIux9OEvMGqX73jJxXQqD7H9AhCL_dpxYBJrP0Oi + curl -X POST --header "Content-Type:application/json" --data '{"username":"GitHub CI - Adapter SASJS-TESTS (FAIL)", "content":"Automated sasjs-tests failed on the @sasjs/adapter PR on following link.\n'$2'", "avatar_url":"https://i.ibb.co/Lpk7Xvq/error-outline.png"}' $1 # curl -X POST --data-urlencode "payload={\"channel\":\"#sasjs\", \"username\":\"GitHub CI\", \"text\":\"Publish of a @sasjs/adapter has been canceled because of the failing sasjs-tests!\", \"icon_emoji\":\":warning:\"}" $1 echo "Cypress sasjs testing failed!" exit 1