-
Notifications
You must be signed in to change notification settings - Fork 0
125 lines (121 loc) · 6.49 KB
/
generators-integration-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: Generators Integration Tests
on:
pull_request:
branches:
- master
- alpha-*
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: 'Run tests'
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
config:
- {
packageCommand: 'pnpm nx g @brainly-gene/tools:core-module --name my-module --directory examples --tags domain:social-qa && pnpm nx test examples-modules-my-module-module',
successRegexp: 'Successfully ran target test for project examples-modules-my-module-module',
}
- {
packageCommand: 'pnpm nx g @brainly-gene/tools:core-module --name my-module --directory examples --tags domain:social-qa && pnpm nx lint examples-modules-my-module-module',
successRegexp: 'Successfully ran target lint for project examples-modules-my-module-module',
}
- {
packageCommand: 'pnpm nx g @brainly-gene/tools:core-module --name my-module --directory examples --tags domain:social-qa && pnpm nx e2e examples-modules-my-module-module-e2e --verbose',
successRegexp: 'Successfully ran target e2e for project examples-modules-my-module-module-e2e',
}
- {
packageCommand: 'pnpm nx g @brainly-gene/tools:components-library --name my-components --directory examples --tags domain:social-qa && pnpm nx test examples-components-my-components-ui',
successRegexp: 'Successfully ran target test for project examples-components-my-components-ui',
}
- {
packageCommand: 'pnpm nx g @brainly-gene/tools:components-library --name my-components --directory examples --tags domain:social-qa && pnpm nx lint examples-components-my-components-ui',
successRegexp: 'Successfully ran target lint for project examples-components-my-components-ui',
}
- {
packageCommand: 'pnpm nx g @brainly-gene/tools:service --name=my-data --directory=my-feature/services --serviceType=apollo --tags=domain:social-qa && pnpm nx lint my-feature-services-my-data-service',
successRegexp: 'Successfully ran target lint for project my-feature-services-my-data-service',
}
- {
packageCommand: 'pnpm nx g @brainly-gene/tools:service --name=my-data --directory=my-feature/services --serviceType=apollo --tags=domain:social-qa && pnpm nx test my-feature-services-my-data-service',
successRegexp: 'Successfully ran target test for project my-feature-services-my-data-service',
}
- {
packageCommand: 'pnpm nx g @brainly-gene/tools:service --name=my-data --directory=my-feature/services --serviceType=react-query --tags=domain:social-qa && pnpm nx lint my-feature-services-my-data-service',
successRegexp: 'Successfully ran target lint for project my-feature-services-my-data-service',
}
- {
packageCommand: 'pnpm nx g @brainly-gene/tools:service --name=my-data --directory=my-feature/services --serviceType=react-query --tags=domain:social-qa && pnpm nx test my-feature-services-my-data-service',
successRegexp: 'Successfully ran target test for project my-feature-services-my-data-service',
}
- {
packageCommand: 'pnpm nx g @brainly-gene/tools:nextjs-app --name=my-app --directory=example --tags=domain:social-qa --rewrites=true --apollo=true --reactQuery=true --e2e=true && NODE_OPTIONS="--max-old-space-size=8192" pnpm nx e2e example-my-app-e2e --verbose',
successRegexp: 'Successfully ran target e2e for project example-my-app-e2e',
}
- {
packageCommand: 'pnpm nx g @brainly-gene/tools:nextjs-app --name=my-app --directory=example --tags=domain:social-qa --rewrites=true --apollo=true --reactQuery=true --e2e=true && pnpm nx test example-my-app',
successRegexp: 'Successfully ran target test for project example-my-app',
}
- {
packageCommand: 'pnpm nx g @brainly-gene/tools:nextjs-app --name=my-app --directory=example --tags=domain:social-qa --rewrites=true --apollo=true --reactQuery=true --e2e=true && pnpm nx lint example-my-app',
successRegexp: 'Successfully ran target lint for project example-my-app',
}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@7c12f8017d5436eb855f1ed4399f037a36fbd9e8 # v2
with:
node-version: '18.20.0'
- uses: pnpm/action-setup@v4
with:
version: 9.12.0
- name: Restore cached npm dependencies
uses: actions/cache/restore@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
with:
path: node_modules
key: npm-dependencies-${{ hashFiles('pnpm-lock.yaml') }}
- name: Restore cached Cypress binary
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
with:
path: ~/.cache/Cypress
key: cypress-cache-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Install Cypress binary
run: |
npx cypress install
- name: Cache npm dependencies
uses: actions/cache/save@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
with:
path: node_modules
key: npm-dependencies-${{ hashFiles('pnpm-lock.yaml') }}
- name: Cache Cypress binary
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
with:
path: ~/.cache/Cypress
key: cypress-cache-${{ hashFiles('pnpm-lock.yaml') }}
- name: Run script and check stdout
uses: ./.github/actions/generators-integration-tests
timeout-minutes: 10
with:
packageCommand: ${{ matrix.config.packageCommand }}
successRegexp: ${{ matrix.config.successRegexp }}
generators-integration-summary:
name: 'Summary check'
runs-on: ubuntu-latest
needs: build
if: always()
steps:
- name: Successful Generator tests
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: Failing Generator tests
if: ${{ contains(needs.*.result, 'failure') }}
run: |
echo "Some Generator tests failed - please look on particular job logs for more details."
exit 1