1
0
mirror of https://github.com/sasjs/adapter.git synced 2025-12-15 18:54:36 +00:00
Files
adapter/.github/workflows/sasjs-tests.yml
2021-07-16 11:20:26 +02:00

81 lines
2.7 KiB
YAML

# 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
cd sasjs-tests
npm i
npm install -g replace-in-files-cli
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:"SASVIYA",' ./public/config.json
npm run update:adapter && npm run build
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
npm run update:adapter && npm run build
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