From a39b9ea38f648028eaa736cf2bedf2fa7a589d40 Mon Sep 17 00:00:00 2001 From: Mihajlo Date: Fri, 16 Jul 2021 11:14:42 +0200 Subject: [PATCH] chore: auto deploying sasjs-tests --- .github/workflows/sasjs-tests.yml | 78 +++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 .github/workflows/sasjs-tests.yml diff --git a/.github/workflows/sasjs-tests.yml b/.github/workflows/sasjs-tests.yml new file mode 100644 index 0000000..83a180d --- /dev/null +++ b/.github/workflows/sasjs-tests.yml @@ -0,0 +1,78 @@ +# This workflow will do a deploy of testing framework with current version of adapter installed. +# It will run the cypress that will run the tests and see if all of them are passing. + +name: SASjs Tests + +on: + push: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12.x] + + steps: + - uses: actions/checkout@v2 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - name: Install SSH Key + uses: shimataro/ssh-key-action@v2 + with: + key: ${{ secrets.DCGITLAB_KEY }} + + - 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-bionic.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 viya + run: npm i + run: cd sasjs-tests + run: npm i + run: npm install -g replace-in-files-cli + run: replace-in-files --regex='userName.*' --replacement='userName:"${{ secrets.SAS_USERNAME }}",' ./public/config.json + run: replace-in-files --regex='password.*' --replacement='password:"${{ secrets.SAS_PASSWORD }}",' ./public/config.json + run: replace-in-files --regex='serverType.*' --replacement='serverType:"SASVIYA",' ./public/config.json + run: npm run update:adapter && npm run build + run: rsync -avhe ssh ./build/* --delete ${{ secrets.DCGITLAB_DEPLOY_PATH_VIYA }} + + - name: Deploy sasjs-tests sas9 + run: replace-in-files --regex='serverType.*' --replacement='serverType:"SAS9",' ./public/config.json + run: npm run update:adapter && npm run build + run: rsync -avhe ssh ./build/* --delete ${{ secrets.DCGITLAB_DEPLOY_PATH_SAS9 }} + + - name: Run cypress on viya + run: ls + + - name: Run cypress on sas9 + run: ls + env: + CI: true