From 2fd7dcc4ac2e21d7b750370ffc55ab064c6153b1 Mon Sep 17 00:00:00 2001 From: AdityaRoshanG <119289872+AdityaRoshanG@users.noreply.github.com> Date: Mon, 31 Jul 2023 13:00:43 +0530 Subject: [PATCH] Create node.js.yml --- .github/workflows/node.js.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/node.js.yml diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 0000000..5dd601e --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,35 @@ +name: 'BrowserStack Test' +on: [push, pull_request] +jobs: + ubuntu-job: + name: 'BrowserStack Test on Ubuntu' + runs-on: ubuntu-latest # Can be self-hosted runner also + steps: + + - name: 'BrowserStack Env Setup' # Invokes the setup-env action + uses: browserstack/github-actions/setup-env@master + with: + username: ${{ secrets.BROWSERSTACK_USERNAME }} + access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} + + - name: 'BrowserStack Local Tunnel Setup' # Invokes the setup-local action + uses: browserstack/github-actions/setup-local@master + with: + local-testing: start + local-identifier: random + +# The next 3 steps are for building the web application to be tested and starting the web server on the runner environment + + - name: 'Checkout the repository' + uses: actions/checkout@v2 + + - name: 'Building web application to be tested' + run: npm install + + - name: 'Running test on BrowserStack' # Invokes the actual test script that would run on BrowserStack browsers + run: npm run sample-test # See sample test script above + + - name: 'BrowserStackLocal Stop' # Terminating the BrowserStackLocal tunnel connection + uses: browserstack/github-actions/setup-local@master + with: + local-testing: stop