From fd1dc8041c9c4bbb4240e1b1bbd44f456554b681 Mon Sep 17 00:00:00 2001 From: MiniDigger | Martin Date: Sat, 17 Feb 2024 18:04:46 +0100 Subject: [PATCH] chore: port over e2e action --- .github/workflows/e2e.yml | 59 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/e2e.yml diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml new file mode 100644 index 00000000..aa68cbae --- /dev/null +++ b/.github/workflows/e2e.yml @@ -0,0 +1,59 @@ +name: e2e + +on: + # allow manual dispatch + workflow_dispatch: + # run on pushes to staging + push: + branches: + - staging + - autoimport + +jobs: + e2e: + name: 'Hangar E2E Tests' + runs-on: ubuntu-latest + steps: + - name: BrowserStack Env Setup + uses: browserstack/github-actions/setup-env@master + with: + username: ${{ secrets.BROWSERSTACK_USERNAME }} + access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} + + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Set up pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 + + - name: Get pnpm store directory + id: pnpm-cache + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT + + - name: Cache Pnpm + uses: actions/cache@v4 + with: + path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install e2e deps + env: + CI: true + run: (cd e2e && pnpm install --frozen-lockfile) + + - name: Run e2e tests + env: + BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} + BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }} + run: (cd e2e && pnpm run browserstack-multiple)