|
76 | 76 | env: |
77 | 77 | NODE_AUTH_TOKEN: ${{ secrets.NPM_GITHUB_PACKAGES }} |
78 | 78 |
|
79 | | - - name: Build Outline |
80 | | - run: yarn build --force |
81 | | - |
82 | | - - name: Build Storybook |
83 | | - run: yarn storybook:build |
84 | | - |
85 | 79 | # Job to run build, and basic assurances the codebase is ready for additional processing. |
86 | | - build: |
87 | | - name: Build Codebase |
| 80 | + build_outline: |
| 81 | + name: Build Outline Codebase |
88 | 82 | runs-on: ubuntu-latest |
89 | 83 | needs: ['setup'] |
90 | 84 | strategy: |
@@ -123,6 +117,54 @@ jobs: |
123 | 117 | - name: Build Storybook |
124 | 118 | run: yarn storybook:build |
125 | 119 |
|
| 120 | + # Test initialization of a new project |
| 121 | + build_project: |
| 122 | + name: Initialize and Test Build of Project Codebase |
| 123 | + runs-on: ubuntu-latest |
| 124 | + needs: ['build_outline'] |
| 125 | + strategy: |
| 126 | + matrix: |
| 127 | + node: [ 16, 18 ] |
| 128 | + # The steps for the setup job. |
| 129 | + steps: |
| 130 | + # @see https://github.com/marketplace/actions/checkout |
| 131 | + - name: Checkout Codebase |
| 132 | + uses: actions/checkout@v3 |
| 133 | + |
| 134 | + - uses: actions/setup-node@v3 |
| 135 | + with: |
| 136 | + node-version: ${{ matrix.node }} |
| 137 | + cache: 'yarn' |
| 138 | + |
| 139 | + # @see https://github.com/marketplace/actions/cache |
| 140 | + # node_modules caching is validated by always running yarn install. |
| 141 | + # Turborepo cache lives inside node_modules/.cache/turbo |
| 142 | + - uses: actions/cache@v3 |
| 143 | + id: yarn-cache |
| 144 | + with: |
| 145 | + path: | |
| 146 | + node_modules |
| 147 | + storybook-static |
| 148 | + key: ${{ runner.os }}-node-${{ matrix.node }}-yarn-${{ hashFiles('**/yarn.lock') }} |
| 149 | + restore-keys: | |
| 150 | + ${{ runner.os }}-node-${{ matrix.node }}-yarn- |
| 151 | +
|
| 152 | + - name: Install |
| 153 | + run: yarn install --prefer-offline |
| 154 | + |
| 155 | + - name: Build from cache |
| 156 | + run: yarn build |
| 157 | + |
| 158 | + - name: Generate a project |
| 159 | + run: | |
| 160 | + PROJDIR=$(mktemp -d) |
| 161 | + cd $PROJDIR |
| 162 | + npx ${{ github.workspace }}/packages/outline-cli init -a -l -s prj |
| 163 | + cd prj |
| 164 | + yarn install --prefer-offline |
| 165 | + yarn build |
| 166 | + yarn storybook:build |
| 167 | +
|
126 | 168 | # Job to run package publishing process. |
127 | 169 | test: |
128 | 170 | name: Test Codebase |
@@ -175,7 +217,7 @@ jobs: |
175 | 217 | name: "Publish: GitHub Pages" |
176 | 218 | if: github.ref == 'refs/heads/next' |
177 | 219 | runs-on: ubuntu-latest |
178 | | - needs: ['setup', 'build', 'test'] |
| 220 | + needs: ['setup', 'build_outline', 'test'] |
179 | 221 |
|
180 | 222 | # The steps for the setup job. |
181 | 223 | steps: |
@@ -242,7 +284,7 @@ jobs: |
242 | 284 | name: "Publish: GitHub Packages" |
243 | 285 | runs-on: ubuntu-latest |
244 | 286 | if: github.ref == 'refs/heads/release' |
245 | | - needs: ['setup', 'build', 'test'] |
| 287 | + needs: ['setup', 'build_outline', 'test'] |
246 | 288 |
|
247 | 289 | # The steps for the build job. |
248 | 290 | steps: |
@@ -294,7 +336,7 @@ jobs: |
294 | 336 | name: "Publish: NPM Packages" |
295 | 337 | runs-on: ubuntu-latest |
296 | 338 | if: github.ref == 'refs/heads/release' |
297 | | - needs: ['setup', 'build', 'test'] |
| 339 | + needs: ['setup', 'build_outline', 'test'] |
298 | 340 |
|
299 | 341 | # The steps for the build job. |
300 | 342 | steps: |
@@ -343,7 +385,7 @@ jobs: |
343 | 385 | chromatic-deployment: |
344 | 386 | name: "Publish: Chromatic" |
345 | 387 | runs-on: ubuntu-latest |
346 | | - needs: ['setup', 'build', 'test'] |
| 388 | + needs: ['setup', 'build_outline', 'test'] |
347 | 389 |
|
348 | 390 | steps: |
349 | 391 | # @see https://github.com/marketplace/actions/checkout |
|
0 commit comments