Skip to content

Commit

Permalink
ci: add e2e test sharding
Browse files Browse the repository at this point in the history
  • Loading branch information
sgomez committed Mar 28, 2024
1 parent 3380f7d commit 10b0f4e
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 13 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/cache-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Run unit and integration tests

on:
push:
branches:
- 'test-ci'
pull_request:
branches:
- 'test-ci'

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 20.x ]
name: Run tests on Node ${{ matrix.node-version }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile --prefer-offline
- name: Run tests
run: yarn test:ci
22 changes: 9 additions & 13 deletions .github/workflows/shard-e2e.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
name: Run e2e tests

on:
push:
branches:
- 'test-ci'
pull_request:
branches:
- 'test-ci'
workflow_call:

#on:
# push:
# branches:
# - 'test-ci'
# pull_request:
# branches:
# - 'test-ci'

env:
MAILER_SECRET: E2E
Expand Down Expand Up @@ -91,13 +94,6 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@v4
with:
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Run tests
Expand Down

0 comments on commit 10b0f4e

Please sign in to comment.