-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
50 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# Step 5 | ||
name: Execute Bati CLI and run E2E tests | ||
|
||
inputs: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,18 @@ | ||
name: Tests | ||
|
||
# Step 2 | ||
on: | ||
pull_request: | ||
paths-ignore: | ||
- 'website/**' | ||
push: | ||
# Ensures cache is computed on main branch so that it can be reused on all PRs | ||
branches: [ "main" ] | ||
paths-ignore: | ||
- 'website/**' | ||
|
||
concurrency: | ||
group: ${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
workflow_call: | ||
inputs: | ||
os: | ||
required: true | ||
type: string | ||
node: | ||
required: true | ||
type: number | ||
fast: | ||
type: boolean | ||
jobs: | ||
monorepo: | ||
runs-on: ${{ matrix.os }} | ||
runs-on: ${{ inputs.os }} | ||
|
||
# Debug discrepancies between published package and local one | ||
# services: | ||
|
@@ -26,20 +22,14 @@ jobs: | |
# ports: | ||
# - 4873:4873 | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
node: [20] | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
node-version: ${{ inputs.node }} | ||
|
||
- uses: pnpm/action-setup@v4 | ||
name: Install pnpm | ||
|
@@ -60,9 +50,9 @@ jobs: | |
name: Setup pnpm cache | ||
with: | ||
path: ${{ env.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
key: ${{ inputs.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
${{ inputs.os }}-pnpm-store- | ||
- name: Cache for Turbo | ||
uses: rharkor/[email protected] | ||
|
@@ -104,7 +94,7 @@ jobs: | |
- name: Archive Bati CLI | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: bati-cli-${{ matrix.os }}-${{ matrix.node }} | ||
name: bati-cli-${{ inputs.os }}-${{ inputs.node }} | ||
if-no-files-found: error | ||
retention-days: 1 | ||
overwrite: true | ||
|
@@ -117,7 +107,7 @@ jobs: | |
- name: Archive Bati tests | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: bati-tests-${{ matrix.os }}-${{ matrix.node }} | ||
name: bati-tests-${{ inputs.os }}-${{ inputs.node }} | ||
if-no-files-found: error | ||
retention-days: 1 | ||
overwrite: true | ||
|
@@ -131,7 +121,7 @@ jobs: | |
- name: Archive tests-utils | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: tests-utils-${{ matrix.os }}-${{ matrix.node }} | ||
name: tests-utils-${{ inputs.os }}-${{ inputs.node }} | ||
if-no-files-found: error | ||
retention-days: 1 | ||
overwrite: true | ||
|
@@ -141,7 +131,7 @@ jobs: | |
- name: Archive tests files | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: tests-files-${{ matrix.os }}-${{ matrix.node }} | ||
name: tests-files-${{ inputs.os }}-${{ inputs.node }} | ||
if-no-files-found: error | ||
retention-days: 1 | ||
overwrite: true | ||
|
@@ -150,18 +140,7 @@ jobs: | |
|
||
- name: List e2e tests | ||
id: list-e2e | ||
run: pnpm run test:e2e list --workers 5 | ||
env: | ||
TEST_AUTH0_CLIENT_ID: ${{ secrets.TEST_AUTH0_CLIENT_ID }} | ||
TEST_AUTH0_ISSUER_BASE_URL: ${{ secrets.TEST_AUTH0_ISSUER_BASE_URL }} | ||
TEST_FIREBASE_ACCOUNT: ${{ secrets.TEST_FIREBASE_ACCOUNT }} | ||
TEST_FIREBASE_USER_UID: ${{ secrets.TEST_FIREBASE_USER_UID }} | ||
TEST_GITHUB_CLIENT_ID: ${{ secrets.TEST_GITHUB_CLIENT_ID }} | ||
TEST_GITHUB_CLIENT_SECRET: ${{ secrets.TEST_GITHUB_CLIENT_SECRET }} | ||
|
||
- name: List e2e tests | ||
id: list-e2e-small | ||
run: pnpm run test:e2e list --workers 1 --filter=react,hono | ||
run: pnpm run test:e2e list ${{ inputs.fast && '--workers 1 --filter=react,h3' || '--workers 5' }} | ||
env: | ||
TEST_AUTH0_CLIENT_ID: ${{ secrets.TEST_AUTH0_CLIENT_ID }} | ||
TEST_AUTH0_ISSUER_BASE_URL: ${{ secrets.TEST_AUTH0_ISSUER_BASE_URL }} | ||
|
@@ -172,15 +151,6 @@ jobs: | |
|
||
outputs: | ||
test-matrix: ${{ steps.list-e2e.outputs.test-matrix }} | ||
test-matrix-small: ${{ steps.list-e2e-small.outputs.test-matrix }} | ||
|
||
# - name: Archive summary | ||
# if: matrix.os == 'ubuntu-latest' | ||
# uses: actions/upload-artifact@v4 | ||
# with: | ||
# name: ${{ runner.os }}-${{ matrix.node }}-summary | ||
# path: | | ||
# ${{ runner.temp }}/bati/.turbo/runs/*.json | ||
|
||
generated: | ||
needs: monorepo | ||
|
@@ -190,39 +160,9 @@ jobs: | |
test-matrix: ${{ fromJson(needs.monorepo.outputs.test-matrix) }} | ||
name: "Trigger e2e tests: Group ${{ matrix.test-matrix[0] }}" | ||
|
||
uses: ./.github/workflows/reusable.yml | ||
secrets: inherit | ||
with: | ||
entry: ${{ matrix.test-matrix[1] }} | ||
os: ubuntu-latest | ||
node: 20 | ||
|
||
generated-windows: | ||
needs: monorepo | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
test-matrix: ${{ fromJson(needs.monorepo.outputs.test-matrix-small) }} | ||
name: "Trigger e2e tests: Group Windows" | ||
|
||
uses: ./.github/workflows/reusable.yml | ||
secrets: inherit | ||
with: | ||
entry: ${{ matrix.test-matrix[1] }} | ||
os: windows-latest | ||
node: 20 | ||
|
||
generated-macos: | ||
needs: monorepo | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
test-matrix: ${{ fromJson(needs.monorepo.outputs.test-matrix-small) }} | ||
name: "Trigger e2e tests: Group MacOS" | ||
|
||
uses: ./.github/workflows/reusable.yml | ||
uses: ./.github/workflows/tests-generated.reusable.yml | ||
secrets: inherit | ||
with: | ||
entry: ${{ matrix.test-matrix[1] }} | ||
os: macos-latest | ||
node: 20 | ||
os: ${{ inputs.os }} | ||
node: ${{ inputs.node }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Step 1 | ||
name: Tests | ||
|
||
on: | ||
pull_request: | ||
paths-ignore: | ||
- 'website/**' | ||
push: | ||
# Ensures cache is computed on main branch so that it can be reused on all PRs | ||
branches: [ "main" ] | ||
paths-ignore: | ||
- 'website/**' | ||
|
||
concurrency: | ||
group: ${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
monorepo: | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest, macos-latest, windows-latest ] | ||
node: [ 20 ] | ||
fail-fast: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters