From abe95f5432ca9a28f84345b2e5ccfe44b279e085 Mon Sep 17 00:00:00 2001 From: munja Date: Sun, 7 Aug 2022 13:47:50 +0100 Subject: [PATCH] chore: moving github docs to .github folder and migrating discord hook to matrix --- CODE_OF_CONDUCT.md => .github/CODE_OF_CONDUCT.md | 0 CONTRIBUTING.md => .github/CONTRIBUTING.md | 0 .../PULL_REQUEST_TEMPLATE.md | 0 .github/workflows/build.yml | 12 ++++++------ sasjs-cypress-run.sh | 3 +-- 5 files changed, 7 insertions(+), 8 deletions(-) rename CODE_OF_CONDUCT.md => .github/CODE_OF_CONDUCT.md (100%) rename CONTRIBUTING.md => .github/CONTRIBUTING.md (100%) rename PULL_REQUEST_TEMPLATE.md => .github/PULL_REQUEST_TEMPLATE.md (100%) diff --git a/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md similarity index 100% rename from CODE_OF_CONDUCT.md rename to .github/CODE_OF_CONDUCT.md diff --git a/CONTRIBUTING.md b/.github/CONTRIBUTING.md similarity index 100% rename from CONTRIBUTING.md rename to .github/CONTRIBUTING.md diff --git a/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md similarity index 100% rename from PULL_REQUEST_TEMPLATE.md rename to .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8199fc1..a3ad5bc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,16 +24,16 @@ jobs: - name: Check npm audit run: npm audit --production --audit-level=low - + - name: Install Dependencies run: npm ci - + - name: Check code style run: npm run lint - + - name: Run unit tests run: npm test - + - name: Build Package run: npm run package:lib env: @@ -41,7 +41,7 @@ jobs: - name: Install SSH Key uses: shimataro/ssh-key-action@v2 - with: + with: key: ${{ secrets.DCGITLAB_KEY }} known_hosts: 'placeholder' @@ -88,7 +88,7 @@ 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.DISCORD_WEBHOOK }} https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} + sh ./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 - name: Generate coverage report diff --git a/sasjs-cypress-run.sh b/sasjs-cypress-run.sh index 0edd99d..13ade8a 100755 --- a/sasjs-cypress-run.sh +++ b/sasjs-cypress-run.sh @@ -3,8 +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":"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 -XPOST -d '{"msgtype":"m.text", "body":"content":"Automated sasjs-tests failed on the @sasjs/adapter PR on following link.\n'$2'"}' https://matrix.4gl.io/_matrix/client/r0/rooms/%21BDUPBPEGVvRLKLQUxY:4gl.io/send/m.room.message?access_token=$1 echo "Cypress sasjs testing failed!" exit 1 fi