Skip to content

Commit 98afafb

Browse files
committed
chore(github): add E2E workflow for mikroORM and integrate into PR workflow
1 parent fd05093 commit 98afafb

File tree

4 files changed

+78
-3
lines changed

4 files changed

+78
-3
lines changed
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: ⚙️ E2E Test
2+
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
mainBranch:
8+
description: Type for main nx affect
9+
required: false
10+
default: "master"
11+
type: string
12+
secrets:
13+
NX_CLOUD_ACCESS_TOKEN:
14+
required: true
15+
16+
env:
17+
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
18+
19+
20+
jobs:
21+
e2e-test:
22+
runs-on: ubuntu-latest
23+
# services:
24+
# postgres:
25+
# image: postgres
26+
# env:
27+
# POSTGRES_PASSWORD: postgres
28+
# POSTGRES_DB: json-api-db
29+
# options: >-
30+
# --health-cmd pg_isready
31+
# --health-interval 10s
32+
# --health-timeout 5s
33+
# --health-retries 5
34+
# ports:
35+
# - 5432:5432
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@v4
39+
with:
40+
fetch-depth: 0
41+
- name: Setup Node.js
42+
uses: ./.github/actions
43+
44+
- name: Determine base for NX affected (if not master)
45+
if: ${{ inputs.mainBranch != 'master' }}
46+
shell: bash
47+
run: |
48+
LAST_TAG=$(git describe --tags --abbrev=0)
49+
LAST_TAG_HASH=$(git rev-parse "$LAST_TAG")
50+
CURRENT_COMMIT=$(git rev-parse HEAD)
51+
echo "Using last tag hash as NX_BASE: $LAST_TAG_HASH"
52+
echo "Using current commit as NX_HEAD: $CURRENT_COMMIT"
53+
echo "NX_BASE=$LAST_TAG_HASH" >> $GITHUB_ENV
54+
echo "NX_HEAD=$CURRENT_COMMIT" >> $GITHUB_ENV
55+
56+
- name: Determine base for NX affected (if master)
57+
if: ${{ inputs.mainBranch == 'master' }}
58+
uses: nrwl/nx-set-shas@v4
59+
with:
60+
main-branch-name: ${{ inputs.mainBranch }}
61+
62+
# - run: npm run typeorm migration:run
63+
# - run: npm run seed:run
64+
# - run: npx nx run json-api-server-e2e:e2e --parallel=1
65+
- run: npx nx run json-api-server-e2e:e2e-micro --parallel=1

.github/workflows/e2e-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ jobs:
6262
# - run: npm run typeorm migration:run
6363
# - run: npm run seed:run
6464
- run: npx nx run json-api-server-e2e:e2e --parallel=1
65-
- run: npx nx run json-api-server-e2e:e2e-micro --parallel=1
65+
# - run: npx nx run json-api-server-e2e:e2e-micro --parallel=1

.github/workflows/pr.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,14 @@ jobs:
1515
secrets:
1616
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
1717

18+
e2e-test-mikroorm:
19+
needs: [ test ]
20+
uses: ./.github/workflows/e2e-test-mikroorm.yml
21+
secrets:
22+
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
23+
1824
build:
19-
needs: [test, e2e-test]
25+
needs: [test, e2e-test, e2e-test-mikroorm]
2026
uses: ./.github/workflows/build.yml
2127
secrets:
2228
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}

libs/acl-permissions/nestjs-acl-permissions/project.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,9 @@
5959
"dependsOn": ["build"]
6060
}
6161
},
62-
"tags": []
62+
"tags": [
63+
"type:lib",
64+
"lib:nestjs-acl-permissions",
65+
"type:publish"
66+
]
6367
}

0 commit comments

Comments
 (0)