diff --git a/.github/workflows/build-test-lint.yml b/.github/workflows/build-test-lint.yml index 63fb1487..7628e7d4 100644 --- a/.github/workflows/build-test-lint.yml +++ b/.github/workflows/build-test-lint.yml @@ -32,6 +32,23 @@ jobs: # run: dotnet format --verify-no-changes # working-directory: Xero-NetStandard - # - name: Run Test - # run: dotnet test - # working-directory: Xero-NetStandard \ No newline at end of file + - name: Set up Node environment + uses: actions/setup-node@v2 + with: + node-version: 20 + + - name: Install Prism + run: npm install -g @stoplight/prism-cli + + - name: Start PRISM Server + run: ./start-prism.sh & sleep 15 + working-directory: Xero-NetStandard/Xero.NetStandard.OAuth2.Test/util + + - name: Run Test + run: dotnet test + working-directory: Xero-NetStandard + + - name: Stop PRISM + if: success() || failure() + run: pkill -f prism + working-directory: Xero-NetStandard \ No newline at end of file diff --git a/Xero.NetStandard.OAuth2.Test/util/start-prism.sh b/Xero.NetStandard.OAuth2.Test/util/start-prism.sh old mode 100644 new mode 100755 index b9b564dd..f6d3aa00 --- a/Xero.NetStandard.OAuth2.Test/util/start-prism.sh +++ b/Xero.NetStandard.OAuth2.Test/util/start-prism.sh @@ -1,3 +1,5 @@ +#!/bin/bash + prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero_accounting.yaml --host 127.0.0.1 --port 4010 & prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero-app-store.yaml --host 127.0.0.1 --port 4011 & prism mock https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/refs/heads/master/xero_assets.yaml --host 127.0.0.1 --port 4012 &