diff --git a/.github/actions/cache-playwright/action.yml b/.github/actions/cache-playwright/action.yml index fb6994896c..6cd8e26ee4 100644 --- a/.github/actions/cache-playwright/action.yml +++ b/.github/actions/cache-playwright/action.yml @@ -1,15 +1,10 @@ -name: Install playwright binaries -description: "Install playwright, cache and restore if necessary" -inputs: - node_version: - required: true - description: "The node version used to run this" +name: Cache playwright binaries +description: "Cache playwright or restore if necessary" runs: using: "composite" steps: - name: Cache playwright binaries uses: actions/cache@v2 - id: playwright-cache with: path: | ~/Library/Caches/ms-playwright @@ -17,7 +12,3 @@ runs: ${{ github.workspace }}/node_modules/playwright key: cache-playwright-${{ hashFiles('**/yarn.lock') }} restore-keys: cache-playwright- - - name: Install playwright deps - if: steps.playwright-cache.outputs.cache-hit != 'true' - shell: bash - run: yarn playwright install diff --git a/.github/actions/dangerous-git-checkout/action.yml b/.github/actions/dangerous-git-checkout/action.yml new file mode 100644 index 0000000000..e27e7c976a --- /dev/null +++ b/.github/actions/dangerous-git-checkout/action.yml @@ -0,0 +1,10 @@ +name: Dangerous git Checkout +description: "Git Checkout from PR code so we can run checks from forks" +runs: + using: "composite" + steps: + - name: Checkout repo + uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.sha }} # + fetch-depth: 2 diff --git a/.github/actions/yarn-playwright-install/action.yml b/.github/actions/yarn-playwright-install/action.yml new file mode 100644 index 0000000000..e21cb03371 --- /dev/null +++ b/.github/actions/yarn-playwright-install/action.yml @@ -0,0 +1,11 @@ +name: Install playwright binaries +description: "Install playwright, cache and restore if necessary" +runs: + using: "composite" + steps: + - uses: ./.github/actions/cache-playwright + id: playwright-cache + - name: Yarn install + shell: bash + if: steps.playwright-cache.outputs.cache-hit != 'true' + run: yarn playwright install diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index fa4490934c..130ff2d0bd 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -64,20 +64,13 @@ jobs: - 5432:5432 steps: - - name: Checkout repo - uses: actions/checkout@v2 - with: - ref: ${{ github.event.pull_request.head.sha }} # So we can test on forks - fetch-depth: 2 + - uses: ./.github/actions/dangerous-git-checkout - run: echo 'NODE_OPTIONS="--max_old_space_size=4096"' >> $GITHUB_ENV - - name: Use Node 16.x - uses: actions/setup-node@v3 + - uses: ./.github/actions/yarn-install with: - node-version: 16.x - cache: "yarn" - - uses: ./.github/actions/cache-playwright + node_version: ${{ secrets.node_version }} + - uses: ./.github/actions/yarn-playwright-install - run: yarn test-e2e - - name: Upload test results if: ${{ always() }} uses: actions/upload-artifact@v2