This repository has been archived by the owner on Dec 9, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
122 lines (113 loc) · 3.99 KB
/
__generators.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
name: 'Generators'
on:
workflow_call:
inputs:
affected:
description: >
Run for affected projects.
required: false
default: true
type: boolean
examples:
description: >
The Nx version to test against
required: false
type: string
default: '["country-info", "fake-api", "rfam", "stackexchange", "star-wars", "trippin"]'
node_version:
description: >
Optionally define the version of Node to install.
required: false
default: 'lts/*'
type: string
nx_version:
description: >
The Nx version to test against
required: false
type: string
default: '["15.7.1", "15.7", "15.8", "latest"]'
save_cache:
description: >
Should the cache be saved upon completion?
required: false
default: false
type: boolean
secrets:
NX_CLOUD_ACCESS_TOKEN:
description: 'The NX Cloud API token'
required: true
NX__TRIPPIN__API_KEY:
description: 'The Trippin API Key'
required: true
concurrency:
group: generators--${{ github.workflow }}--${{ github.ref }}
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
NX__TRIPPIN__API_KEY: ${{ secrets.NX__TRIPPIN__API_KEY }}
jobs:
generator:
name: Generator - nx-${{ matrix.nx_version }}/${{ matrix.example }}/${{ matrix.type }}
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
type: [application, sdk, preset]
example: ${{fromJson(inputs.examples)}}
nx_version: ${{fromJson(inputs.nx_version)}}
steps:
- name: Check out repository
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3
with:
fetch-depth: 0
- name: Setup Job
uses: ./.github/actions/setup-job
id: setup
with:
node_version: ${{ inputs.node_version }}
skip_node_cache: 'true'
- name: Restore PNPM cache
uses: actions/cache/restore@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
id: pnpm-cache
with:
path: |
${{ steps.setup.outputs.pnpm_directory }}
key: |
generators--pnpm--nx-${{ matrix.nx_version }}--type-${{ matrix.type }}--example-${{ matrix.example }}
- name: Download Nx Mesh
uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3
with:
name: nx-mesh
- name: Test Generator - (node-${{ inputs.node_version }}/nx-${{ matrix.nx_version }}/${{ matrix.type }}-${{ matrix.example }})
shell: bash
run: |
cd ../
pnpm dlx create-nx-workspace@${{ matrix.nx_version }} \
--name=generator \
--appName=${{ matrix.example }} \
--preset=apps \
--interactive=false \
--nxCloud=false \
--style=css \
--skipGit
cd generator
pnpm nx report
npm pkg set "pnpm.overrides.@nrwl/cypress"="${{ matrix.nx_version }}"
npm pkg set "pnpm.overrides.@nrwl/jest"="${{ matrix.nx_version }}"
npm pkg set "pnpm.overrides.@nrwl/js"="${{ matrix.nx_version }}"
npm pkg set "pnpm.overrides.@nrwl/node"="${{ matrix.nx_version }}"
npm pkg set "pnpm.overrides.@nrwl/webpack"="${{ matrix.nx_version }}"
pnpm add ../nx-mesh/nx-mesh.tar.gz
pnpm nx report
pnpm exec nx generate nx-mesh:${{ matrix.type }} \
${{ matrix.example }} \
--example=${{ matrix.example }} \
--no-interactive
pnpm nx run ${{ matrix.example }}:build
- name: Save PNPM cache
uses: actions/cache/save@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
with:
path: |
${{ steps.setup.outputs.pnpm_directory }}
key: |
generators--pnpm--nx-${{ matrix.nx_version }}--type-${{ matrix.type }}--example-${{ matrix.example }}