|
1 |
| -# This is a basic workflow to help you get started with Actions |
2 |
| - |
3 | 1 | name: CI
|
4 | 2 |
|
5 |
| -# Controls when the action will run. Triggers the workflow on push or pull request |
6 |
| -# events but only for the master branch |
7 | 3 | on:
|
| 4 | + schedule: |
| 5 | + - cron: '0 15 * * 2' # Tuesday 3PM UTC (8AM PST) |
8 | 6 | push:
|
9 | 7 | branches: [ main ]
|
10 |
| - pull_request: |
11 |
| - branches: [ main ] |
| 8 | + workflow_dispatch: |
12 | 9 |
|
13 |
| -# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
14 | 10 | jobs:
|
15 |
| - codegen: |
16 |
| - runs-on: windows-2022 |
17 |
| - steps: |
18 |
| - - name: setup git |
19 |
| - run: | |
20 |
| - git config --global core.autocrlf false |
21 |
| - git config --global core.filemode false |
22 |
| -
|
23 |
| - - uses: actions/checkout@v2 |
24 |
| - |
25 |
| - - name: yarn install |
26 |
| - run: yarn install |
27 |
| - |
28 |
| - - uses: nuget/setup-nuget@v1 |
29 |
| - |
30 |
| - - name: NuGet restore |
31 |
| - run: nuget restore example\windows\example.sln |
32 |
| - |
33 |
| - - name: run CodeGen |
34 |
| - run: dotnet run -verbose -winmd $env:USERPROFILE\.nuget\packages\microsoft.ui.xaml\2.7.0\lib\uap10.0\Microsoft.UI.Xaml.winmd |
35 |
| - working-directory: package\Codegen |
36 |
| - |
37 |
| - - name: build TS |
38 |
| - run: yarn build |
39 |
| - |
40 |
| - - name: verify no changes from CodeGen |
41 |
| - shell: powershell |
42 |
| - run: | |
43 |
| - $changed = git status --porcelain=v1 |
44 |
| - $changed |
45 |
| - if ($changed -ne $null) { throw "CodeGen detected changes" } |
46 |
| -
|
47 |
| - examplenuget: |
48 |
| - runs-on: windows-2022 |
49 |
| - steps: |
50 |
| - - uses: actions/checkout@v2 |
51 |
| - |
52 |
| - - name: yarn install |
53 |
| - run: yarn install |
54 |
| - |
55 |
| - - name: build TS |
56 |
| - run: yarn build |
57 |
| - |
58 |
| - - name: build ExampleNuget |
59 |
| - run: yarn windows --no-launch --no-deploy --no-packager --logging |
60 |
| - working-directory: examplenuget |
61 |
| - |
62 |
| - - name: Upload appx |
63 |
| - uses: actions/upload-artifact@v2 |
64 |
| - with: |
65 |
| - name: ExampleNuget appx |
66 |
| - path: examplenuget\windows\AppPackages\examplenuget\examplenuget_1.0.0.0_x64_Debug_Test |
67 |
| - if-no-files-found: error |
68 |
| - |
69 |
| - |
70 |
| - testcli-old: |
71 |
| - runs-on: windows-2019 |
| 11 | + call-runcodegen: |
| 12 | + name: Run CodeGen |
| 13 | + uses: ./.github/workflows/template-runcodegen.yml |
| 14 | + with: |
| 15 | + vmImage: windows-2022 |
| 16 | + |
| 17 | + call-buildexample: |
| 18 | + name: Build Example |
72 | 19 | strategy:
|
73 | 20 | fail-fast: false
|
74 | 21 | matrix:
|
75 |
| - rnwSource: ['Source', 'NuGet'] # test building with both RNW source and RNW NuGet |
76 |
| - rnwVersion: ['^0.67', '^0.69'] # test key versions (min, partners) |
77 |
| - steps: |
78 |
| - - uses: actions/checkout@v2 |
79 |
| - |
80 |
| - - name: yarn install |
81 |
| - run: yarn install |
82 |
| - |
83 |
| - - name: build TS |
84 |
| - run: yarn build |
85 |
| - |
86 |
| - - name: yarn link |
87 |
| - run: yarn link |
88 |
| - working-directory: package |
89 |
| - |
90 |
| - - name: create ${{ matrix.rnwVersion }} app |
91 |
| - run: npx react-native init testrnx --template react-native@${{ matrix.rnwVersion }} |
92 |
| - |
93 |
| - - name: add Windows (RNW via ${{ matrix.rnwSource }}) |
94 |
| - run: npx react-native-windows-init --overwrite ${{ matrix.rnwSource == 'NuGet' && '--experimentalNuGetDependency true' || '' }} |
95 |
| - working-directory: testrnx |
96 |
| - |
97 |
| - - name: link react-native-xaml |
98 |
| - run: yarn link react-native-xaml |
99 |
| - working-directory: testrnx |
100 |
| - |
101 |
| - - name: add react-native-xaml |
102 |
| - run: yarn add react-native-xaml |
103 |
| - working-directory: testrnx |
104 |
| - |
105 |
| - - name: autolink |
106 |
| - run: npx react-native autolink-windows --logging |
107 |
| - working-directory: testrnx |
108 |
| - |
109 |
| - - name: update WinUI package version |
110 |
| - run: ..\.github\workflows\SetUpAppForNuget.ps1 ${{ matrix.rnwSource == 'NuGet' && '-UseNuGet' || '' }} |
111 |
| - working-directory: testrnx |
112 |
| - |
113 |
| - - name: build app |
114 |
| - run: npx react-native run-windows --no-launch --no-deploy --no-packager --logging |
115 |
| - working-directory: testrnx |
116 |
| - |
117 |
| - testcli: |
118 |
| - runs-on: windows-2022 |
| 22 | + exampleName: ['example', 'examplenuget'] # build both examples |
| 23 | + uses: ./.github/workflows/template-buildexample.yml |
| 24 | + with: |
| 25 | + vmImage: windows-2022 |
| 26 | + exampleName: ${{ matrix.exampleName }} |
| 27 | + |
| 28 | + call-testcli: |
| 29 | + name: Test CLI |
119 | 30 | strategy:
|
120 | 31 | fail-fast: false
|
121 | 32 | matrix:
|
122 |
| - rnwSource: ['Source', 'NuGet'] # test building with both RNW source and RNW NuGet |
123 |
| - rnwVersion: ['^0.71'] # test key versions (latest) |
124 |
| - steps: |
125 |
| - - uses: actions/checkout@v2 |
126 |
| - |
127 |
| - - name: yarn install |
128 |
| - run: yarn install |
129 |
| - |
130 |
| - - name: build TS |
131 |
| - run: yarn build |
132 |
| - |
133 |
| - - name: yarn link |
134 |
| - run: yarn link |
135 |
| - working-directory: package |
136 |
| - |
137 |
| - - name: create ${{ matrix.rnwVersion }} app |
138 |
| - run: npx react-native init testrnx --template react-native@${{ matrix.rnwVersion }} |
139 |
| - |
140 |
| - - name: add Windows (RNW via ${{ matrix.rnwSource }}) |
141 |
| - run: npx react-native-windows-init --overwrite ${{ matrix.rnwSource == 'NuGet' && '--experimentalNuGetDependency true' || '' }} |
142 |
| - working-directory: testrnx |
143 |
| - |
144 |
| - - name: link react-native-xaml |
145 |
| - run: yarn link react-native-xaml |
146 |
| - working-directory: testrnx |
147 |
| - |
148 |
| - - name: add react-native-xaml |
149 |
| - run: yarn add react-native-xaml |
150 |
| - working-directory: testrnx |
151 |
| - |
152 |
| - - name: autolink |
153 |
| - run: npx react-native autolink-windows --logging |
154 |
| - working-directory: testrnx |
155 |
| - |
156 |
| - - name: update WinUI package version |
157 |
| - run: ..\.github\workflows\SetUpAppForNuget.ps1 ${{ matrix.rnwSource == 'NuGet' && '-UseNuGet' || '' }} |
158 |
| - working-directory: testrnx |
159 |
| - |
160 |
| - - name: build app |
161 |
| - run: npx react-native run-windows --no-launch --no-deploy --no-packager --logging |
162 |
| - working-directory: testrnx |
163 |
| - |
164 |
| - package: |
165 |
| - runs-on: windows-2022 |
166 |
| - steps: |
167 |
| - - uses: actions/checkout@v2 |
168 |
| - |
169 |
| - - name: setup-msbuild |
170 |
| - uses: microsoft/setup-msbuild@v1 |
171 |
| - |
172 |
| - - name: yarn install |
173 |
| - run: yarn install |
174 |
| - |
175 |
| - - name: build TS |
176 |
| - run: yarn build |
177 |
| - |
178 |
| - - name: npm pack |
179 |
| - run: npm pack |
180 |
| - working-directory: package |
181 |
| - |
182 |
| - - name: Upload npm package |
183 |
| - uses: actions/upload-artifact@v2 |
184 |
| - with: |
185 |
| - name: npm package |
186 |
| - path: package\*.tgz |
187 |
| - if-no-files-found: error |
188 |
| - |
189 |
| - - name: build Release x64 |
190 |
| - run: msbuild /restore /p:RestorePackagesConfig=true package\windows\ReactNativeXaml.sln /p:configuration=Release /p:platform=x64 |
191 |
| - |
192 |
| - - name: Validate size |
193 |
| - shell: powershell |
194 |
| - run: | |
195 |
| - $size = (gci package\windows\x64\Release\ReactNativeXaml\ReactNativeXaml.dll).Length |
196 |
| - $size |
197 |
| - if ($size -gt 1.5MB) { |
198 |
| - throw "DLL is bigger than 1.5MB" |
199 |
| - } |
200 |
| -
|
| 33 | + rnwVersion: ['^0.71'] # test supported versions |
| 34 | + useRnwNuGet: [false, true] # test building with both RNW source and RNW NuGet |
| 35 | + uses: ./.github/workflows/template-testcli.yml |
| 36 | + with: |
| 37 | + vmImage: windows-2022 |
| 38 | + rnwVersion: ${{ matrix.rnwVersion }} |
| 39 | + useRnwNuGet: ${{ matrix.useRnwNuGet }} |
| 40 | + |
| 41 | + call-testcli-old: |
| 42 | + name: Test CLI (Old) |
| 43 | + strategy: |
| 44 | + fail-fast: false |
| 45 | + matrix: |
| 46 | + rnwVersion: ['^0.67', '^0.68', '^0.69', '^0.70'] # test supported versions |
| 47 | + useRnwNuGet: [false, true] # test building with both RNW source and RNW NuGet |
| 48 | + uses: ./.github/workflows/template-testcli.yml |
| 49 | + with: |
| 50 | + vmImage: windows-2019 |
| 51 | + rnwVersion: ${{ matrix.rnwVersion }} |
| 52 | + useRnwNuGet: ${{ matrix.useRnwNuGet }} |
| 53 | + |
| 54 | + call-buildnpmpackage: |
| 55 | + name: Build NPM Package |
| 56 | + uses: ./.github/workflows/template-buildnpmpackage.yml |
| 57 | + with: |
| 58 | + vmImage: windows-2022 |
| 59 | + |
| 60 | + call-buildrnx: |
| 61 | + name: Build RNX |
| 62 | + strategy: |
| 63 | + fail-fast: false |
| 64 | + matrix: |
| 65 | + configuration: ['Debug', 'Release'] |
| 66 | + platform: ['x64'] |
| 67 | + uses: ./.github/workflows/template-buildrnx.yml |
| 68 | + with: |
| 69 | + vmImage: windows-2022 |
| 70 | + configuration: ${{ matrix.configuration }} |
| 71 | + platform: ${{ matrix.platform }} |
0 commit comments