Skip to content

Snippets generation feature #1010

Snippets generation feature

Snippets generation feature #1010

# 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: Run mocked tests on Windows
on:
pull_request:
jobs:
test:
runs-on: windows-latest
strategy:
matrix:
node-version: [lts/hydrogen]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: npm
# - name: Install Doxygen
# run: choco install doxygen.install
#
# `choco install doxygen.install` is unreliable
- name: Install Doxygen
run: |
git clone https://github.com/sasjs/doxygen-installer.git
.\doxygen-installer\install.bat
- name: Add doxygen to path
run: echo "C:\Program Files\doxygen\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Check doxygen version
run: doxygen -v
- name: Create .env file for sasjs/server
run: |
touch .env
echo RUN_TIMES=js >> .env
echo NODE_PATH=node >> .env
- name: download sasjs/server package from github using curl
run: curl -L https://github.com/sasjs/server/releases/latest/download/windows.zip --output windows.zip
- name: unzip downloaded package
run: npx extract-zip windows.zip
- name: run sasjs server in background
run: START .\api-win.exe >> run-sasjs-server.txt
- name: Install dependencies
run: |
npm config set registry http://registry.npmjs.org
npm ci
- name: Check code style
run: npm run lint
- name: Build Project
run: npm run build
- name: Test Package Install
run: npm version "5.0.0" --no-git-tag-version && npm pack && npm install -g ./sasjs-cli-5.0.0.tgz && sasjs v
- name: npm prefix for user
run: echo prefix=C:\npm\prefix >> ~\.npmrc
- name: Sasjs Server started
run: cat run-sasjs-server.txt
- name: Run mocked tests
run: npm run test:mocked
env:
CI: true
CLIENT: ${{secrets.CLIENT}}
SECRET: ${{secrets.SECRET}}
SAS_USERNAME: ${{secrets.SAS_USERNAME}}
SAS_PASSWORD: ${{secrets.SAS_PASSWORD}}
VIYA_SERVER_URL: ${{secrets.VIYA_SERVER_URL}}
SAS9_SERVER_URL: ${{secrets.SAS9_SERVER_URL}}
SASJS_SERVER_URL: 'http://localhost:5000'
ACCESS_TOKEN: ${{secrets.ACCESS_TOKEN}}
REFRESH_TOKEN: ${{secrets.REFRESH_TOKEN}}