mirror of
https://github.com/sasjs/core.git
synced 2025-12-11 06:24:35 +00:00
85 lines
2.6 KiB
YAML
85 lines
2.6 KiB
YAML
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
|
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
|
|
|
name: Node.js CI
|
|
|
|
on:
|
|
pull_request:
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
matrix:
|
|
node-version: [lts/fermium]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
uses: actions/setup-node@v2
|
|
with:
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
- 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: Install Doxygen
|
|
run: sudo apt-get install doxygen
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Check code style
|
|
run: npm run lint
|
|
|
|
- name: Add client
|
|
run: echo "CLIENT=${{secrets.CLIENT}}"> .env.viya
|
|
|
|
- name: Add secret
|
|
run: echo "SECRET=${{secrets.SECRET}}" >> .env.viya
|
|
|
|
- name: Add access token
|
|
run: echo "ACCESS_TOKEN=${{secrets.ACCESS_TOKEN}}" >> .env.viya
|
|
|
|
- name: Add refresh token
|
|
run: echo "REFRESH_TOKEN=${{secrets.REFRESH_TOKEN}}" >> .env.viya
|
|
|
|
- name: Build Project
|
|
run: npm run build
|
|
|
|
- name: Run SASjs tests
|
|
run: npm run test
|
|
env:
|
|
CI: true
|
|
CLIENT: ${{secrets.CLIENT}}
|
|
SECRET: ${{secrets.SECRET}}
|
|
SAS_USERNAME: ${{secrets.SAS_USERNAME}}
|
|
SAS_PASSWORD: ${{secrets.SAS_PASSWORD}}
|
|
SERVER_URL: ${{secrets.SERVER_URL}}
|
|
SERVER_TYPE: ${{secrets.SERVER_TYPE}}
|
|
ACCESS_TOKEN: ${{secrets.ACCESS_TOKEN}}
|
|
REFRESH_TOKEN: ${{secrets.REFRESH_TOKEN}}
|