diff --git a/.github/vpn/config.ovpn b/.github/vpn/config.ovpn index abd1a7487..17a46ed2f 100644 --- a/.github/vpn/config.ovpn +++ b/.github/vpn/config.ovpn @@ -13,7 +13,7 @@ remote vpn.analytium.co.uk 1194 udp remote vpn.analytium.co.uk 1194 udp dev tun dev-type tun -ns-cert-type server +remote-cert-tls server setenv opt tls-version-min 1.0 or-highest reneg-sec 604800 sndbuf 0 @@ -27,4 +27,4 @@ setenv PUSH_PEER_INFO ca ca.crt cert user.crt key user.key -tls-auth tls.key 1 +tls-auth tls.key 1 \ No newline at end of file diff --git a/.github/workflows/run-tests-windows.yml b/.github/workflows/run-tests-windows.yml index 91e27eb7b..3b448d1a5 100644 --- a/.github/workflows/run-tests-windows.yml +++ b/.github/workflows/run-tests-windows.yml @@ -21,15 +21,48 @@ jobs: with: node-version: ${{ matrix.node-version }} + - name: Disable Firewall + run: | + netsh advfirewall set allprofiles state off + Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False + + - name: Install OpenSSL + run: | + $env:PATH = "C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\chocolatey\bin" + [Environment]::SetEnvironmentVariable("Path", $env:PATH, "Machine") + choco install --yes openssl --no-progress + echo "C:\Program Files\OpenSSL-Win64\bin" >> $env:GITHUB_PATH + shell: powershell + + - name: Install OpenVPN + run: | + $env:PATH = "C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\chocolatey\bin" + [Environment]::SetEnvironmentVariable("Path", $env:PATH, "Machine") + choco install --yes openvpn --no-progress + echo "C:\Program Files\OpenVPN\bin" >> $env:GITHUB_PATH + shell: powershell + + - name: Write VPN Files + run: | + echo $Env:CA_CRT | Out-File -FilePath .github/vpn/ca.crt -Encoding utf8 + echo $Env:USER_CRT | Out-File -FilePath .github/vpn/user.crt -Encoding utf8 + echo $Env:USER_KEY | Out-File -FilePath .github/vpn/user.key -Encoding utf8 + echo $Env:TLS_KEY | Out-File -FilePath .github/vpn/tls.key -Encoding utf8 + env: + CA_CRT: ${{ secrets.CA_CRT}} + USER_CRT: ${{ secrets.USER_CRT }} + USER_KEY: ${{ secrets.USER_KEY }} + TLS_KEY: ${{ secrets.TLS_KEY }} + + - name: Connect to VPN + run: cd .github/vpn && openvpn --config config.ovpn + - name: Install Doxygen - run: choco install doxygen.install --version 1.9.1 + run: choco install doxygen.install --version 1.9.1 --no-progress - - name: Add doxygen to path + - 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: Install dependencies run: npm ci @@ -42,7 +75,7 @@ jobs: - name: Link run: npm link - - name: npm prefix for user + - name: Write .npmrc file run: echo prefix=C:\npm\prefix >> ~\.npmrc - name: Run mocked tests @@ -57,3 +90,16 @@ jobs: SAS9_SERVER_URL: ${{secrets.SAS9_SERVER_URL}} ACCESS_TOKEN: ${{secrets.ACCESS_TOKEN}} REFRESH_TOKEN: ${{secrets.REFRESH_TOKEN}} + + - name: Run server tests + run: npm run test:server + 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}} + ACCESS_TOKEN: ${{secrets.ACCESS_TOKEN}} + REFRESH_TOKEN: ${{secrets.REFRESH_TOKEN}}