mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
cba99a13e7
Bumps the github-actions group with 6 updates: | Package | From | To | | --- | --- | --- | | [step-security/harden-runner](https://github.com/step-security/harden-runner) | `2.12.0` | `2.12.1` | | [chromaui/action](https://github.com/chromaui/action) | `12.1.1` | `12.2.0` | | [actions/attest](https://github.com/actions/attest) | `2.3.0` | `2.4.0` | | [tj-actions/changed-files](https://github.com/tj-actions/changed-files) | `115870536a85eaf050e369291c7895748ff12aea` | `d52d20fa3f981cb852b861fd8f55308b5fe29637` | | [github/codeql-action](https://github.com/github/codeql-action) | `3.28.19` | `3.29.0` | | [umbrelladocs/action-linkspector](https://github.com/umbrelladocs/action-linkspector) | `1.3.4` | `1.3.5` | Updates `step-security/harden-runner` from 2.12.0 to 2.12.1 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/step-security/harden-runner/releases">step-security/harden-runner's releases</a>.</em></p> <blockquote> <h2>v2.12.1</h2> <h2>What's Changed</h2> <ul> <li>Detection capabilities have been upgraded to better recognize attempts at runner tampering. These improvements are informed by real-world incident learnings, including analysis of anomalous behaviors observed in the tj-actions and reviewdog supply chain attack.</li> <li>Resolved an issue where the block policy was not enforced correctly when the GitHub Actions job was running inside a container on a self-hosted VM runner.</li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/step-security/harden-runner/compare/v2...v2.12.1">https://github.com/step-security/harden-runner/compare/v2...v2.12.1</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/step-security/harden-runner/commit/002fdce3c6a235733a90a27c80493a3241e56863"><code>002fdce</code></a> Merge pull request <a href="https://redirect.github.com/step-security/harden-runner/issues/544">#544</a> from step-security/rc-21</li> <li><a href="https://github.com/step-security/harden-runner/commit/2489e3fcb3d00eac3cb27c9b490431a4d26eac58"><code>2489e3f</code></a> Merge branch 'main' into rc-21</li> <li><a href="https://github.com/step-security/harden-runner/commit/75dd441a816c3c7ea21313ec8ff21d9f7b69f534"><code>75dd441</code></a> Merge pull request <a href="https://redirect.github.com/step-security/harden-runner/issues/555">#555</a> from step-security/dependabot/github_actions/step-sec...</li> <li><a href="https://github.com/step-security/harden-runner/commit/4381ace9c4db180c9cc8ff9a6dd4220f17a95690"><code>4381ace</code></a> Bump step-security/publish-unit-test-result-action from 2.19.0 to 2.20.0</li> <li><a href="https://github.com/step-security/harden-runner/commit/a9da90b635b492e68edb2a24949fcab1e313e9eb"><code>a9da90b</code></a> Merge pull request <a href="https://redirect.github.com/step-security/harden-runner/issues/553">#553</a> from h0x0er/feat/container-workflows</li> <li><a href="https://github.com/step-security/harden-runner/commit/a60ef21c0c1f49c7ac6c8d65b6f4d16d419789c1"><code>a60ef21</code></a> update</li> <li><a href="https://github.com/step-security/harden-runner/commit/4ad512f16553ff1c022684cc96be0329a7618db8"><code>4ad512f</code></a> Merge branch 'rc-21' into feat/container-workflows</li> <li><a href="https://github.com/step-security/harden-runner/commit/6b41a3923518db2abe77790e47793760b5c47c28"><code>6b41a39</code></a> fixed test case</li> <li><a href="https://github.com/step-security/harden-runner/commit/fa70c45ca9a73bcef023a3e6afac49ffa3007480"><code>fa70c45</code></a> update agent</li> <li><a href="https://github.com/step-security/harden-runner/commit/eb47845632e48a7532e7e363ba78b9bc48c09264"><code>eb47845</code></a> self-hosted: refactored block-policy apply logic</li> <li>Additional commits viewable in <a href="https://github.com/step-security/harden-runner/compare/0634a2670c59f64b4a01f0f96f84700a4088b9f0...002fdce3c6a235733a90a27c80493a3241e56863">compare view</a></li> </ul> </details> <br /> Updates `chromaui/action` from 12.1.1 to 12.2.0 <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/chromaui/action/commit/c50adf8eaa8c2878af3263499a73077854de39d4"><code>c50adf8</code></a> v12.2.0</li> <li>See full diff in <a href="https://github.com/chromaui/action/compare/8536229ee904071f8edce292596f6dbe0da96b9b...c50adf8eaa8c2878af3263499a73077854de39d4">compare view</a></li> </ul> </details> <br /> Updates `actions/attest` from 2.3.0 to 2.4.0 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions/attest/releases">actions/attest's releases</a>.</em></p> <blockquote> <h2>v2.4.0</h2> <h2>What's Changed</h2> <ul> <li>Bump <code>@actions/github</code> from 6.0.0 to 6.0.1 in the npm-production group by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/actions/attest/pull/242">actions/attest#242</a></li> <li>Bump undici from 5.28.5 to 5.29.0 by <a href="https://github.com/dependabot"><code>@dependabot</code></a> in <a href="https://redirect.github.com/actions/attest/pull/246">actions/attest#246</a></li> <li>Add path to created attestation in a well-known summary file by <a href="https://github.com/kommendorkapten"><code>@kommendorkapten</code></a> in <a href="https://redirect.github.com/actions/attest/pull/252">actions/attest#252</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/kommendorkapten"><code>@kommendorkapten</code></a> made their first contribution in <a href="https://redirect.github.com/actions/attest/pull/252">actions/attest#252</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/attest/compare/v2...v2.4.0">https://github.com/actions/attest/compare/v2...v2.4.0</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/actions/attest/commit/ce27ba3b4a9a139d9a20a4a07d69fabb52f1e5bc"><code>ce27ba3</code></a> bump package version to 2.4.0 (<a href="https://redirect.github.com/actions/attest/issues/253">#253</a>)</li> <li><a href="https://github.com/actions/attest/commit/6a89e1286443a80c6d1e0cebb7b24d8299c16774"><code>6a89e12</code></a> Add path to created attestation in a well-known summary file (<a href="https://redirect.github.com/actions/attest/issues/252">#252</a>)</li> <li><a href="https://github.com/actions/attest/commit/cbc14bbf255d1e79ad201d4308009aabd79cafdc"><code>cbc14bb</code></a> Bump the npm-development group with 3 updates (<a href="https://redirect.github.com/actions/attest/issues/250">#250</a>)</li> <li><a href="https://github.com/actions/attest/commit/b87aa13652d8ee3c0c86d3582b965c842f7f388f"><code>b87aa13</code></a> Bump the npm-development group across 1 directory with 5 updates (<a href="https://redirect.github.com/actions/attest/issues/249">#249</a>)</li> <li><a href="https://github.com/actions/attest/commit/5ae9aa28e10f70b771c67101892b7ffc141ef958"><code>5ae9aa2</code></a> Bump undici from 5.28.5 to 5.29.0 (<a href="https://redirect.github.com/actions/attest/issues/246">#246</a>)</li> <li><a href="https://github.com/actions/attest/commit/4119d34e49ca6230f84a5e799710eae4f2428d02"><code>4119d34</code></a> Bump the npm-development group across 1 directory with 6 updates (<a href="https://redirect.github.com/actions/attest/issues/245">#245</a>)</li> <li><a href="https://github.com/actions/attest/commit/7e777b150d7bec9c2cfe2c0993b186c15e97e81c"><code>7e777b1</code></a> Bump <code>@actions/github</code> from 6.0.0 to 6.0.1 in the npm-production group (<a href="https://redirect.github.com/actions/attest/issues/242">#242</a>)</li> <li><a href="https://github.com/actions/attest/commit/4d8a13a13f8c2075b78844846f6d7e38b6a920bf"><code>4d8a13a</code></a> Bump super-linter/super-linter in the actions-minor group (<a href="https://redirect.github.com/actions/attest/issues/244">#244</a>)</li> <li><a href="https://github.com/actions/attest/commit/647f15244eb261577c4910e1356026e9c1d9cda9"><code>647f152</code></a> Bump the npm-development group with 4 updates (<a href="https://redirect.github.com/actions/attest/issues/240">#240</a>)</li> <li><a href="https://github.com/actions/attest/commit/20551343079b1bce85b235f46add92bbbddb8a7a"><code>2055134</code></a> Bump the npm-development group with 4 updates (<a href="https://redirect.github.com/actions/attest/issues/239">#239</a>)</li> <li>Additional commits viewable in <a href="https://github.com/actions/attest/compare/afd638254319277bb3d7f0a234478733e2e46a73...ce27ba3b4a9a139d9a20a4a07d69fabb52f1e5bc">compare view</a></li> </ul> </details> <br /> Updates `tj-actions/changed-files` from 115870536a85eaf050e369291c7895748ff12aea to d52d20fa3f981cb852b861fd8f55308b5fe29637 <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/tj-actions/changed-files/blob/main/HISTORY.md">tj-actions/changed-files's changelog</a>.</em></p> <blockquote> <h1>Changelog</h1> <h1><a href="https://github.com/tj-actions/changed-files/compare/v46.0.4...v46.0.5">46.0.5</a> - (2025-04-09)</h1> <h2><!-- raw HTML omitted -->⚙️ Miscellaneous Tasks</h2> <ul> <li><strong>deps:</strong> Bump yaml from 2.7.0 to 2.7.1 (<a href="https://redirect.github.com/tj-actions/changed-files/issues/2520">#2520</a>) (<a href="https://github.com/tj-actions/changed-files/commit/ed68ef82c095e0d48ec87eccea555d944a631a4c">ed68ef8</a>) - (dependabot[bot])</li> <li><strong>deps-dev:</strong> Bump typescript from 5.8.2 to 5.8.3 (<a href="https://redirect.github.com/tj-actions/changed-files/issues/2516">#2516</a>) (<a href="https://github.com/tj-actions/changed-files/commit/a7bc14b808f23d3b467a4079c69a81f1a4500fd5">a7bc14b</a>) - (dependabot[bot])</li> <li><strong>deps-dev:</strong> Bump <code>@types/node</code> from 22.13.11 to 22.14.0 (<a href="https://redirect.github.com/tj-actions/changed-files/issues/2517">#2517</a>) (<a href="https://github.com/tj-actions/changed-files/commit/3d751f6b6d84071a17e1b9cf4ed79a80a27dd0ab">3d751f6</a>) - (dependabot[bot])</li> <li><strong>deps-dev:</strong> Bump eslint-plugin-prettier from 5.2.3 to 5.2.6 (<a href="https://redirect.github.com/tj-actions/changed-files/issues/2519">#2519</a>) (<a href="https://github.com/tj-actions/changed-files/commit/e2fda4ec3cb0bc2a353843cae823430b3124db8f">e2fda4e</a>) - (dependabot[bot])</li> <li><strong>deps-dev:</strong> Bump ts-jest from 29.2.6 to 29.3.1 (<a href="https://redirect.github.com/tj-actions/changed-files/issues/2518">#2518</a>) (<a href="https://github.com/tj-actions/changed-files/commit/0bed1b1132ec4879a39a2d624cf82a00d0bcfa48">0bed1b1</a>) - (dependabot[bot])</li> <li><strong>deps:</strong> Bump github/codeql-action from 3.28.12 to 3.28.15 (<a href="https://redirect.github.com/tj-actions/changed-files/issues/2530">#2530</a>) (<a href="https://github.com/tj-actions/changed-files/commit/68024587dc36f49685c96d59d3f1081830f968bb">6802458</a>) - (dependabot[bot])</li> <li><strong>deps:</strong> Bump tj-actions/branch-names from 8.0.1 to 8.1.0 (<a href="https://redirect.github.com/tj-actions/changed-files/issues/2521">#2521</a>) (<a href="https://github.com/tj-actions/changed-files/commit/cf2e39e86bf842d1f9bc5bca56c0a6b207cca792">cf2e39e</a>) - (dependabot[bot])</li> <li><strong>deps:</strong> Bump tj-actions/verify-changed-files from 20.0.1 to 20.0.4 (<a href="https://redirect.github.com/tj-actions/changed-files/issues/2523">#2523</a>) (<a href="https://github.com/tj-actions/changed-files/commit/6abeaa506a419f85fa9e681260b443adbeebb3d4">6abeaa5</a>) - (dependabot[bot])</li> </ul> <h2><!-- raw HTML omitted -->⬆️ Upgrades</h2> <ul> <li>Upgraded to v46.0.4 (<a href="https://redirect.github.com/tj-actions/changed-files/issues/2511">#2511</a>)</li> </ul> <p>Co-authored-by: github-actions[bot] <!-- raw HTML omitted --> (<a href="https://github.com/tj-actions/changed-files/commit/6f67ee9ac810f0192ea7b3d2086406f97847bcf9">6f67ee9</a>) - (github-actions[bot])</p> <h1><a href="https://github.com/tj-actions/changed-files/compare/v46.0.3...v46.0.4">46.0.4</a> - (2025-04-03)</h1> <h2><!-- raw HTML omitted -->🐛 Bug Fixes</h2> <ul> <li>Bug modified_keys and changed_key outputs not set when no changes detected (<a href="https://redirect.github.com/tj-actions/changed-files/issues/2509">#2509</a>) (<a href="https://github.com/tj-actions/changed-files/commit/6cb76d07bee4c9772c6882c06c37837bf82a04d3">6cb76d0</a>) - (Tonye Jack)</li> </ul> <h2><!-- raw HTML omitted -->📚 Documentation</h2> <ul> <li>Update readme (<a href="https://redirect.github.com/tj-actions/changed-files/issues/2508">#2508</a>) (<a href="https://github.com/tj-actions/changed-files/commit/b74df86ccb65173a8e33ba5492ac1a2ca6b216fd">b74df86</a>) - (Tonye Jack)</li> </ul> <h2><!-- raw HTML omitted -->⬆️ Upgrades</h2> <ul> <li>Upgraded to v46.0.3 (<a href="https://redirect.github.com/tj-actions/changed-files/issues/2506">#2506</a>)</li> </ul> <p>Co-authored-by: github-actions[bot] <!-- raw HTML omitted --> Co-authored-by: Tonye Jack <a href="mailto:jtonye@ymail.com">jtonye@ymail.com</a> (<a href="https://github.com/tj-actions/changed-files/commit/27ae6b33eaed7bf87272fdeb9f1c54f9facc9d99">27ae6b3</a>) - (github-actions[bot])</p> <h1><a href="https://github.com/tj-actions/changed-files/compare/v46.0.2...v46.0.3">46.0.3</a> - (2025-03-23)</h1> <h2><!-- raw HTML omitted -->🔄 Update</h2> <ul> <li>Updated README.md (<a href="https://redirect.github.com/tj-actions/changed-files/issues/2501">#2501</a>)</li> </ul> <p>Co-authored-by: github-actions[bot] <!-- raw HTML omitted --> (<a href="https://github.com/tj-actions/changed-files/commit/41e0de576a0f2b64d9f06f2773f539109e55a70a">41e0de5</a>) - (github-actions[bot])</p> <ul> <li>Updated README.md (<a href="https://redirect.github.com/tj-actions/changed-files/issues/2499">#2499</a>)</li> </ul> <p>Co-authored-by: github-actions[bot] <!-- raw HTML omitted --> (<a href="https://github.com/tj-actions/changed-files/commit/945787811a795cd840a1157ac590dd7827a05c8e">9457878</a>) - (github-actions[bot])</p> <h2><!-- raw HTML omitted -->📚 Documentation</h2> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/tj-actions/changed-files/commit/d52d20fa3f981cb852b861fd8f55308b5fe29637"><code>d52d20f</code></a> chore(deps-dev): bump <code>@types/node</code> from 22.15.26 to 24.0.1 (<a href="https://redirect.github.com/tj-actions/changed-files/issues/2587">#2587</a>)</li> <li><a href="https://github.com/tj-actions/changed-files/commit/f1c0eb959957d4094cf86adeb8bb4852f373e197"><code>f1c0eb9</code></a> chore(deps-dev): bump eslint-plugin-prettier from 5.4.0 to 5.4.1 (<a href="https://redirect.github.com/tj-actions/changed-files/issues/2578">#2578</a>)</li> <li><a href="https://github.com/tj-actions/changed-files/commit/944a0f723952a370222de3178b25805235c65933"><code>944a0f7</code></a> chore(deps-dev): bump eslint-plugin-jest from 28.13.0 to 28.13.3 (<a href="https://redirect.github.com/tj-actions/changed-files/issues/2585">#2585</a>)</li> <li><a href="https://github.com/tj-actions/changed-files/commit/3dbc1e181273d808ccff822a6e00cf18b6628ef0"><code>3dbc1e1</code></a> Updated README.md (<a href="https://redirect.github.com/tj-actions/changed-files/issues/2592">#2592</a>)</li> <li><a href="https://github.com/tj-actions/changed-files/commit/7a7221b7baecf19ec83f6a411a2670a43174c883"><code>7a7221b</code></a> chore(deps): bump github/codeql-action from 3.28.18 to 3.29.0 (<a href="https://redirect.github.com/tj-actions/changed-files/issues/2588">#2588</a>)</li> <li><a href="https://github.com/tj-actions/changed-files/commit/c260d49a827b5eb266673bed7871c5d3ee9b5aef"><code>c260d49</code></a> feat: add any_added to outputs (<a href="https://redirect.github.com/tj-actions/changed-files/issues/2567">#2567</a>)</li> <li><a href="https://github.com/tj-actions/changed-files/commit/b1ccff8c0892ad141d7d2de6f31e526a9dad931f"><code>b1ccff8</code></a> Updated README.md (<a href="https://redirect.github.com/tj-actions/changed-files/issues/2591">#2591</a>)</li> <li><a href="https://github.com/tj-actions/changed-files/commit/a892f50f7a7187bc288633c09230b09ce7ad8fd0"><code>a892f50</code></a> docs: update link to glob patterns (<a href="https://redirect.github.com/tj-actions/changed-files/issues/2590">#2590</a>)</li> <li><a href="https://github.com/tj-actions/changed-files/commit/5ca5422070674a4bb487ecebf3c33251f3723c9b"><code>5ca5422</code></a> chore(deps-dev): bump ts-jest from 29.3.4 to 29.4.0 (<a href="https://redirect.github.com/tj-actions/changed-files/issues/2589">#2589</a>)</li> <li><a href="https://github.com/tj-actions/changed-files/commit/4140eb99d2cced9bfd78375c2088371853262f79"><code>4140eb9</code></a> chore(deps-dev): bump eslint-plugin-jest from 28.12.0 to 28.13.0 (<a href="https://redirect.github.com/tj-actions/changed-files/issues/2583">#2583</a>)</li> <li>See full diff in <a href="https://github.com/tj-actions/changed-files/compare/115870536a85eaf050e369291c7895748ff12aea...d52d20fa3f981cb852b861fd8f55308b5fe29637">compare view</a></li> </ul> </details> <br /> Updates `github/codeql-action` from 3.28.19 to 3.29.0 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/github/codeql-action/releases">github/codeql-action's releases</a>.</em></p> <blockquote> <h2>v3.29.0</h2> <h1>CodeQL Action Changelog</h1> <p>See the <a href="https://github.com/github/codeql-action/releases">releases page</a> for the relevant changes to the CodeQL CLI and language packs.</p> <h2>3.29.0 - 11 Jun 2025</h2> <ul> <li>Update default CodeQL bundle version to 2.22.0. <a href="https://redirect.github.com/github/codeql-action/pull/2925">#2925</a></li> <li>Bump minimum CodeQL bundle version to 2.16.6. <a href="https://redirect.github.com/github/codeql-action/pull/2912">#2912</a></li> </ul> <p>See the full <a href="https://github.com/github/codeql-action/blob/v3.29.0/CHANGELOG.md">CHANGELOG.md</a> for more information.</p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/github/codeql-action/blob/main/CHANGELOG.md">github/codeql-action's changelog</a>.</em></p> <blockquote> <h1>CodeQL Action Changelog</h1> <p>See the <a href="https://github.com/github/codeql-action/releases">releases page</a> for the relevant changes to the CodeQL CLI and language packs.</p> <h2>[UNRELEASED]</h2> <p>No user facing changes.</p> <h2>3.29.0 - 11 Jun 2025</h2> <ul> <li>Update default CodeQL bundle version to 2.22.0. <a href="https://redirect.github.com/github/codeql-action/pull/2925">#2925</a></li> <li>Bump minimum CodeQL bundle version to 2.16.6. <a href="https://redirect.github.com/github/codeql-action/pull/2912">#2912</a></li> </ul> <h2>3.28.19 - 03 Jun 2025</h2> <ul> <li>The CodeQL Action no longer includes its own copy of the extractor for the <code>actions</code> language, which is currently in public preview. The <code>actions</code> extractor has been included in the CodeQL CLI since v2.20.6. If your workflow has enabled the <code>actions</code> language <em>and</em> you have pinned your <code>tools:</code> property to a specific version of the CodeQL CLI earlier than v2.20.6, you will need to update to at least CodeQL v2.20.6 or disable <code>actions</code> analysis.</li> <li>Update default CodeQL bundle version to 2.21.4. <a href="https://redirect.github.com/github/codeql-action/pull/2910">#2910</a></li> </ul> <h2>3.28.18 - 16 May 2025</h2> <ul> <li>Update default CodeQL bundle version to 2.21.3. <a href="https://redirect.github.com/github/codeql-action/pull/2893">#2893</a></li> <li>Skip validating SARIF produced by CodeQL for improved performance. <a href="https://redirect.github.com/github/codeql-action/pull/2894">#2894</a></li> <li>The number of threads and amount of RAM used by CodeQL can now be set via the <code>CODEQL_THREADS</code> and <code>CODEQL_RAM</code> runner environment variables. If set, these environment variables override the <code>threads</code> and <code>ram</code> inputs respectively. <a href="https://redirect.github.com/github/codeql-action/pull/2891">#2891</a></li> </ul> <h2>3.28.17 - 02 May 2025</h2> <ul> <li>Update default CodeQL bundle version to 2.21.2. <a href="https://redirect.github.com/github/codeql-action/pull/2872">#2872</a></li> </ul> <h2>3.28.16 - 23 Apr 2025</h2> <ul> <li>Update default CodeQL bundle version to 2.21.1. <a href="https://redirect.github.com/github/codeql-action/pull/2863">#2863</a></li> </ul> <h2>3.28.15 - 07 Apr 2025</h2> <ul> <li>Fix bug where the action would fail if it tried to produce a debug artifact with more than 65535 files. <a href="https://redirect.github.com/github/codeql-action/pull/2842">#2842</a></li> </ul> <h2>3.28.14 - 07 Apr 2025</h2> <ul> <li>Update default CodeQL bundle version to 2.21.0. <a href="https://redirect.github.com/github/codeql-action/pull/2838">#2838</a></li> </ul> <h2>3.28.13 - 24 Mar 2025</h2> <p>No user facing changes.</p> <h2>3.28.12 - 19 Mar 2025</h2> <ul> <li>Dependency caching should now cache more dependencies for Java <code>build-mode: none</code> extractions. This should speed up workflows and avoid inconsistent alerts in some cases.</li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/github/codeql-action/commit/ce28f5bb42b7a9f2c824e633a3f6ee835bab6858"><code>ce28f5b</code></a> Merge pull request <a href="https://redirect.github.com/github/codeql-action/issues/2926">#2926</a> from github/update-v3.29.0-e8799281c</li> <li><a href="https://github.com/github/codeql-action/commit/bc251b7932638a7881a8db15d1aaf0151642af99"><code>bc251b7</code></a> Update changelog for v3.29.0</li> <li><a href="https://github.com/github/codeql-action/commit/e8799281c8dee3b2e1aaed2c059e530fcfdc2d6d"><code>e879928</code></a> Merge pull request <a href="https://redirect.github.com/github/codeql-action/issues/2925">#2925</a> from github/update-bundle/codeql-bundle-v2.22.0</li> <li><a href="https://github.com/github/codeql-action/commit/efd43b3097c094d883d91934155f0a32af09dff7"><code>efd43b3</code></a> Merge branch 'main' into update-bundle/codeql-bundle-v2.22.0</li> <li><a href="https://github.com/github/codeql-action/commit/7cb9b16051842e6c23c8b9fbcf92481f92d0644a"><code>7cb9b16</code></a> Merge pull request <a href="https://redirect.github.com/github/codeql-action/issues/2912">#2912</a> from github/henrymercer/bump-minimum-codeql-2.16.6</li> <li><a href="https://github.com/github/codeql-action/commit/3855117ba18b27e082b12e3e92e00d1b52aaa605"><code>3855117</code></a> Add changelog note</li> <li><a href="https://github.com/github/codeql-action/commit/f5d4e2a7ca2a5826357748bb8743390a4775946f"><code>f5d4e2a</code></a> Update default bundle to codeql-bundle-v2.22.0</li> <li><a href="https://github.com/github/codeql-action/commit/22deae890c55a1dc3ffba1aa20ad4148284e72d1"><code>22deae8</code></a> Update package-lock.json</li> <li><a href="https://github.com/github/codeql-action/commit/df2a830ca4348a013f4804b56f41795f408f1e4e"><code>df2a830</code></a> Merge branch 'main' into henrymercer/bump-minimum-codeql-2.16.6</li> <li><a href="https://github.com/github/codeql-action/commit/b1e4dc3db58c9601794e22a9f6d28d45461b9dbf"><code>b1e4dc3</code></a> Merge pull request <a href="https://redirect.github.com/github/codeql-action/issues/2916">#2916</a> from github/dependabot/npm_and_yarn/npm-5cdccdc43f</li> <li>Additional commits viewable in <a href="https://github.com/github/codeql-action/compare/fca7ace96b7d713c7035871441bd52efbe39e27e...ce28f5bb42b7a9f2c824e633a3f6ee835bab6858">compare view</a></li> </ul> </details> <br /> Updates `umbrelladocs/action-linkspector` from 1.3.4 to 1.3.5 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/umbrelladocs/action-linkspector/releases">umbrelladocs/action-linkspector's releases</a>.</em></p> <blockquote> <h2>Release v1.3.5</h2> <p>v1.3.5: PR <a href="https://redirect.github.com/umbrelladocs/action-linkspector/issues/45">#45</a> - Update linkspector version to 0.4.5</p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/UmbrellaDocs/action-linkspector/commit/e2ccef58c4b9eb89cd71ee23a8629744bba75aa6"><code>e2ccef5</code></a> Merge pull request <a href="https://redirect.github.com/umbrelladocs/action-linkspector/issues/45">#45</a> from UmbrellaDocs/update-linkspector-version</li> <li><a href="https://github.com/UmbrellaDocs/action-linkspector/commit/6cc23b20f1b7de3860f639255ccebc2b6428c62e"><code>6cc23b2</code></a> Update linkspector version to 0.4.5</li> <li>See full diff in <a href="https://github.com/umbrelladocs/action-linkspector/compare/a0567ce1c7c13de4a2358587492ed43cab5d0102...e2ccef58c4b9eb89cd71ee23a8629744bba75aa6">compare view</a></li> </ul> </details> <br /> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1674 lines
63 KiB
YAML
1674 lines
63 KiB
YAML
name: ci
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
pull_request:
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
# Cancel in-progress runs for pull requests when developers push
|
|
# additional changes
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
|
|
|
jobs:
|
|
changes:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
docs-only: ${{ steps.filter.outputs.docs_count == steps.filter.outputs.all_count }}
|
|
docs: ${{ steps.filter.outputs.docs }}
|
|
go: ${{ steps.filter.outputs.go }}
|
|
site: ${{ steps.filter.outputs.site }}
|
|
k8s: ${{ steps.filter.outputs.k8s }}
|
|
ci: ${{ steps.filter.outputs.ci }}
|
|
db: ${{ steps.filter.outputs.db }}
|
|
gomod: ${{ steps.filter.outputs.gomod }}
|
|
offlinedocs-only: ${{ steps.filter.outputs.offlinedocs_count == steps.filter.outputs.all_count }}
|
|
offlinedocs: ${{ steps.filter.outputs.offlinedocs }}
|
|
tailnet-integration: ${{ steps.filter.outputs.tailnet-integration }}
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
fetch-depth: 1
|
|
# For pull requests it's not necessary to checkout the code
|
|
- name: check changed files
|
|
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
|
|
id: filter
|
|
with:
|
|
filters: |
|
|
all:
|
|
- "**"
|
|
docs:
|
|
- "docs/**"
|
|
- "README.md"
|
|
- "examples/web-server/**"
|
|
- "examples/monitoring/**"
|
|
- "examples/lima/**"
|
|
db:
|
|
- "**.sql"
|
|
- "coderd/database/**"
|
|
go:
|
|
- "**.sql"
|
|
- "**.go"
|
|
- "**.golden"
|
|
- "go.mod"
|
|
- "go.sum"
|
|
# Other non-Go files that may affect Go code:
|
|
- "**.rego"
|
|
- "**.sh"
|
|
- "**.tpl"
|
|
- "**.gotmpl"
|
|
- "**.gotpl"
|
|
- "Makefile"
|
|
- "site/static/error.html"
|
|
# Main repo directories for completeness in case other files are
|
|
# touched:
|
|
- "agent/**"
|
|
- "cli/**"
|
|
- "cmd/**"
|
|
- "coderd/**"
|
|
- "enterprise/**"
|
|
- "examples/**"
|
|
- "helm/**"
|
|
- "provisioner/**"
|
|
- "provisionerd/**"
|
|
- "provisionersdk/**"
|
|
- "pty/**"
|
|
- "scaletest/**"
|
|
- "tailnet/**"
|
|
- "testutil/**"
|
|
gomod:
|
|
- "go.mod"
|
|
- "go.sum"
|
|
site:
|
|
- "site/**"
|
|
k8s:
|
|
- "helm/**"
|
|
- "scripts/Dockerfile"
|
|
- "scripts/Dockerfile.base"
|
|
- "scripts/helm.sh"
|
|
ci:
|
|
- ".github/actions/**"
|
|
- ".github/workflows/ci.yaml"
|
|
offlinedocs:
|
|
- "offlinedocs/**"
|
|
tailnet-integration:
|
|
- "tailnet/**"
|
|
- "go.mod"
|
|
- "go.sum"
|
|
|
|
- id: debug
|
|
run: |
|
|
echo "${{ toJSON(steps.filter )}}"
|
|
|
|
# Disabled due to instability. See: https://github.com/coder/coder/issues/14553
|
|
# Re-enable once the flake hash calculation is stable.
|
|
# update-flake:
|
|
# needs: changes
|
|
# if: needs.changes.outputs.gomod == 'true'
|
|
# runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
|
|
# steps:
|
|
# - name: Checkout
|
|
# uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
# with:
|
|
# fetch-depth: 1
|
|
# # See: https://github.com/stefanzweifel/git-auto-commit-action?tab=readme-ov-file#commits-made-by-this-action-do-not-trigger-new-workflow-runs
|
|
# token: ${{ secrets.CDRCI_GITHUB_TOKEN }}
|
|
|
|
# - name: Setup Go
|
|
# uses: ./.github/actions/setup-go
|
|
|
|
# - name: Update Nix Flake SRI Hash
|
|
# run: ./scripts/update-flake.sh
|
|
|
|
# # auto update flake for dependabot
|
|
# - uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 # v5.0.1
|
|
# if: github.actor == 'dependabot[bot]'
|
|
# with:
|
|
# # Allows dependabot to still rebase!
|
|
# commit_message: "[dependabot skip] Update Nix Flake SRI Hash"
|
|
# commit_user_name: "dependabot[bot]"
|
|
# commit_user_email: "49699333+dependabot[bot]@users.noreply.github.com>"
|
|
# commit_author: "dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>"
|
|
|
|
# # require everyone else to update it themselves
|
|
# - name: Ensure No Changes
|
|
# if: github.actor != 'dependabot[bot]'
|
|
# run: git diff --exit-code
|
|
|
|
lint:
|
|
needs: changes
|
|
if: needs.changes.outputs.offlinedocs-only == 'false' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
|
|
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Setup Node
|
|
uses: ./.github/actions/setup-node
|
|
|
|
- name: Setup Go
|
|
uses: ./.github/actions/setup-go
|
|
|
|
- name: Get golangci-lint cache dir
|
|
run: |
|
|
linter_ver=$(egrep -o 'GOLANGCI_LINT_VERSION=\S+' dogfood/coder/Dockerfile | cut -d '=' -f 2)
|
|
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v$linter_ver
|
|
dir=$(golangci-lint cache status | awk '/Dir/ { print $2 }')
|
|
echo "LINT_CACHE_DIR=$dir" >> $GITHUB_ENV
|
|
|
|
- name: golangci-lint cache
|
|
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
|
|
with:
|
|
path: |
|
|
${{ env.LINT_CACHE_DIR }}
|
|
key: golangci-lint-${{ runner.os }}-${{ hashFiles('**/*.go') }}
|
|
restore-keys: |
|
|
golangci-lint-${{ runner.os }}-
|
|
|
|
# Check for any typos
|
|
- name: Check for typos
|
|
uses: crate-ci/typos@b1ae8d918b6e85bd611117d3d9a3be4f903ee5e4 # v1.33.1
|
|
with:
|
|
config: .github/workflows/typos.toml
|
|
|
|
- name: Fix the typos
|
|
if: ${{ failure() }}
|
|
run: |
|
|
echo "::notice:: you can automatically fix typos from your CLI:
|
|
cargo install typos-cli
|
|
typos -c .github/workflows/typos.toml -w"
|
|
|
|
# Needed for helm chart linting
|
|
- name: Install helm
|
|
uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # v4.3.0
|
|
with:
|
|
version: v3.9.2
|
|
|
|
- name: make lint
|
|
run: |
|
|
make --output-sync=line -j lint
|
|
|
|
- name: Check workflow files
|
|
run: |
|
|
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) 1.7.4
|
|
./actionlint -color -shellcheck= -ignore "set-output"
|
|
shell: bash
|
|
|
|
- name: Check for unstaged files
|
|
run: |
|
|
rm -f ./actionlint ./typos
|
|
./scripts/check_unstaged.sh
|
|
shell: bash
|
|
|
|
gen:
|
|
timeout-minutes: 8
|
|
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
|
|
if: ${{ !cancelled() }}
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Setup Node
|
|
uses: ./.github/actions/setup-node
|
|
|
|
- name: Setup Go
|
|
uses: ./.github/actions/setup-go
|
|
|
|
- name: Setup sqlc
|
|
uses: ./.github/actions/setup-sqlc
|
|
|
|
- name: Setup Terraform
|
|
uses: ./.github/actions/setup-tf
|
|
|
|
- name: go install tools
|
|
uses: ./.github/actions/setup-go-tools
|
|
|
|
- name: Install Protoc
|
|
run: |
|
|
mkdir -p /tmp/proto
|
|
pushd /tmp/proto
|
|
curl -L -o protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v23.4/protoc-23.4-linux-x86_64.zip
|
|
unzip protoc.zip
|
|
cp -r ./bin/* /usr/local/bin
|
|
cp -r ./include /usr/local/bin/include
|
|
popd
|
|
|
|
- name: make gen
|
|
run: |
|
|
# Remove golden files to detect discrepancy in generated files.
|
|
make clean/golden-files
|
|
# Notifications require DB, we could start a DB instance here but
|
|
# let's just restore for now.
|
|
git checkout -- coderd/notifications/testdata/rendered-templates
|
|
# no `-j` flag as `make` fails with:
|
|
# coderd/rbac/object_gen.go:1:1: syntax error: package statement must be first
|
|
make --output-sync -B gen
|
|
|
|
- name: Check for unstaged files
|
|
run: ./scripts/check_unstaged.sh
|
|
|
|
fmt:
|
|
needs: changes
|
|
if: needs.changes.outputs.offlinedocs-only == 'false' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
|
|
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
|
|
timeout-minutes: 7
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Setup Node
|
|
uses: ./.github/actions/setup-node
|
|
|
|
- name: Check Go version
|
|
run: IGNORE_NIX=true ./scripts/check_go_versions.sh
|
|
|
|
# Use default Go version
|
|
- name: Setup Go
|
|
uses: ./.github/actions/setup-go
|
|
|
|
- name: Install shfmt
|
|
run: go install mvdan.cc/sh/v3/cmd/shfmt@v3.7.0
|
|
|
|
- name: make fmt
|
|
run: |
|
|
export PATH=${PATH}:$(go env GOPATH)/bin
|
|
make --output-sync -j -B fmt
|
|
|
|
- name: Check for unstaged files
|
|
run: ./scripts/check_unstaged.sh
|
|
|
|
test-go:
|
|
runs-on: ${{ matrix.os == 'ubuntu-latest' && github.repository_owner == 'coder' && 'depot-ubuntu-22.04-4' || matrix.os == 'macos-latest' && github.repository_owner == 'coder' && 'depot-macos-latest' || matrix.os == 'windows-2022' && github.repository_owner == 'coder' && 'depot-windows-2022-16' || matrix.os }}
|
|
needs: changes
|
|
if: needs.changes.outputs.go == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
|
|
timeout-minutes: 20
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os:
|
|
- ubuntu-latest
|
|
- macos-latest
|
|
- windows-2022
|
|
steps:
|
|
- name: Harden Runner
|
|
# Harden Runner is only supported on Ubuntu runners.
|
|
if: runner.os == 'Linux'
|
|
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
|
|
with:
|
|
egress-policy: audit
|
|
|
|
# Set up RAM disks to speed up the rest of the job. This action is in
|
|
# a separate repository to allow its use before actions/checkout.
|
|
- name: Setup RAM Disks
|
|
if: runner.os == 'Windows'
|
|
uses: coder/setup-ramdisk-action@e1100847ab2d7bcd9d14bcda8f2d1b0f07b36f1b
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Setup Go Paths
|
|
uses: ./.github/actions/setup-go-paths
|
|
|
|
- name: Setup Go
|
|
uses: ./.github/actions/setup-go
|
|
with:
|
|
# Runners have Go baked-in and Go will automatically
|
|
# download the toolchain configured in go.mod, so we don't
|
|
# need to reinstall it. It's faster on Windows runners.
|
|
use-preinstalled-go: ${{ runner.os == 'Windows' }}
|
|
|
|
- name: Setup Terraform
|
|
uses: ./.github/actions/setup-tf
|
|
|
|
- name: Download Test Cache
|
|
id: download-cache
|
|
uses: ./.github/actions/test-cache/download
|
|
with:
|
|
key-prefix: test-go-${{ runner.os }}-${{ runner.arch }}
|
|
|
|
- name: Test with Mock Database
|
|
id: test
|
|
shell: bash
|
|
run: |
|
|
# if macOS, install google-chrome for scaletests. As another concern,
|
|
# should we really have this kind of external dependency requirement
|
|
# on standard CI?
|
|
if [ "${{ matrix.os }}" == "macos-latest" ]; then
|
|
brew install google-chrome
|
|
fi
|
|
|
|
# By default Go will use the number of logical CPUs, which
|
|
# is a fine default.
|
|
PARALLEL_FLAG=""
|
|
|
|
# macOS will output "The default interactive shell is now zsh"
|
|
# intermittently in CI...
|
|
if [ "${{ matrix.os }}" == "macos-latest" ]; then
|
|
touch ~/.bash_profile && echo "export BASH_SILENCE_DEPRECATION_WARNING=1" >> ~/.bash_profile
|
|
fi
|
|
export TS_DEBUG_DISCO=true
|
|
gotestsum --junitfile="gotests.xml" --jsonfile="gotests.json" --rerun-fails=2 \
|
|
--packages="./..." -- $PARALLEL_FLAG -short
|
|
|
|
- name: Upload Test Cache
|
|
uses: ./.github/actions/test-cache/upload
|
|
with:
|
|
cache-key: ${{ steps.download-cache.outputs.cache-key }}
|
|
|
|
- name: Upload test stats to Datadog
|
|
timeout-minutes: 1
|
|
continue-on-error: true
|
|
uses: ./.github/actions/upload-datadog
|
|
if: success() || failure()
|
|
with:
|
|
api-key: ${{ secrets.DATADOG_API_KEY }}
|
|
|
|
test-go-pg:
|
|
# make sure to adjust NUM_PARALLEL_PACKAGES and NUM_PARALLEL_TESTS below
|
|
# when changing runner sizes
|
|
runs-on: ${{ matrix.os == 'ubuntu-latest' && github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || matrix.os && matrix.os == 'macos-latest' && github.repository_owner == 'coder' && 'depot-macos-latest' || matrix.os == 'windows-2022' && github.repository_owner == 'coder' && 'depot-windows-2022-16' || matrix.os }}
|
|
needs: changes
|
|
if: needs.changes.outputs.go == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
|
|
# This timeout must be greater than the timeout set by `go test` in
|
|
# `make test-postgres` to ensure we receive a trace of running
|
|
# goroutines. Setting this to the timeout +5m should work quite well
|
|
# even if some of the preceding steps are slow.
|
|
timeout-minutes: 25
|
|
strategy:
|
|
matrix:
|
|
os:
|
|
- ubuntu-latest
|
|
- macos-latest
|
|
- windows-2022
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
|
|
with:
|
|
egress-policy: audit
|
|
|
|
# macOS indexes all new files in the background. Our Postgres tests
|
|
# create and destroy thousands of databases on disk, and Spotlight
|
|
# tries to index all of them, seriously slowing down the tests.
|
|
- name: Disable Spotlight Indexing
|
|
if: runner.os == 'macOS'
|
|
run: |
|
|
sudo mdutil -a -i off
|
|
sudo mdutil -X /
|
|
sudo launchctl bootout system /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
|
|
|
|
# Set up RAM disks to speed up the rest of the job. This action is in
|
|
# a separate repository to allow its use before actions/checkout.
|
|
- name: Setup RAM Disks
|
|
if: runner.os == 'Windows'
|
|
uses: coder/setup-ramdisk-action@e1100847ab2d7bcd9d14bcda8f2d1b0f07b36f1b
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Setup Go Paths
|
|
id: go-paths
|
|
uses: ./.github/actions/setup-go-paths
|
|
|
|
- name: Download Go Build Cache
|
|
id: download-go-build-cache
|
|
uses: ./.github/actions/test-cache/download
|
|
with:
|
|
key-prefix: test-go-build-${{ runner.os }}-${{ runner.arch }}
|
|
cache-path: ${{ steps.go-paths.outputs.cached-dirs }}
|
|
|
|
- name: Setup Go
|
|
uses: ./.github/actions/setup-go
|
|
with:
|
|
# Runners have Go baked-in and Go will automatically
|
|
# download the toolchain configured in go.mod, so we don't
|
|
# need to reinstall it. It's faster on Windows runners.
|
|
use-preinstalled-go: ${{ runner.os == 'Windows' }}
|
|
# Cache is already downloaded above
|
|
use-cache: false
|
|
|
|
- name: Setup Terraform
|
|
uses: ./.github/actions/setup-tf
|
|
|
|
- name: Download Test Cache
|
|
id: download-cache
|
|
uses: ./.github/actions/test-cache/download
|
|
with:
|
|
key-prefix: test-go-pg-${{ runner.os }}-${{ runner.arch }}
|
|
|
|
- name: Normalize File and Directory Timestamps
|
|
shell: bash
|
|
# Normalize file modification timestamps so that go test can use the
|
|
# cache from the previous CI run. See https://github.com/golang/go/issues/58571
|
|
# for more details.
|
|
run: |
|
|
find . -type f ! -path ./.git/\*\* | mtimehash
|
|
find . -type d ! -path ./.git/\*\* -exec touch -t 200601010000 {} +
|
|
|
|
- name: Test with PostgreSQL Database
|
|
env:
|
|
POSTGRES_VERSION: "13"
|
|
TS_DEBUG_DISCO: "true"
|
|
LC_CTYPE: "en_US.UTF-8"
|
|
LC_ALL: "en_US.UTF-8"
|
|
shell: bash
|
|
run: |
|
|
set -o errexit
|
|
set -o pipefail
|
|
|
|
if [ "${{ runner.os }}" == "Windows" ]; then
|
|
# Create a temp dir on the R: ramdisk drive for Windows. The default
|
|
# C: drive is extremely slow: https://github.com/actions/runner-images/issues/8755
|
|
mkdir -p "R:/temp/embedded-pg"
|
|
go run scripts/embedded-pg/main.go -path "R:/temp/embedded-pg"
|
|
elif [ "${{ runner.os }}" == "macOS" ]; then
|
|
# Postgres runs faster on a ramdisk on macOS too
|
|
mkdir -p /tmp/tmpfs
|
|
sudo mount_tmpfs -o noowners -s 8g /tmp/tmpfs
|
|
go run scripts/embedded-pg/main.go -path /tmp/tmpfs/embedded-pg
|
|
elif [ "${{ runner.os }}" == "Linux" ]; then
|
|
make test-postgres-docker
|
|
fi
|
|
|
|
# if macOS, install google-chrome for scaletests
|
|
# As another concern, should we really have this kind of external dependency
|
|
# requirement on standard CI?
|
|
if [ "${{ matrix.os }}" == "macos-latest" ]; then
|
|
brew install google-chrome
|
|
fi
|
|
|
|
# macOS will output "The default interactive shell is now zsh"
|
|
# intermittently in CI...
|
|
if [ "${{ matrix.os }}" == "macos-latest" ]; then
|
|
touch ~/.bash_profile && echo "export BASH_SILENCE_DEPRECATION_WARNING=1" >> ~/.bash_profile
|
|
fi
|
|
|
|
if [ "${{ runner.os }}" == "Windows" ]; then
|
|
# Our Windows runners have 16 cores.
|
|
# On Windows Postgres chokes up when we have 16x16=256 tests
|
|
# running in parallel, and dbtestutil.NewDB starts to take more than
|
|
# 10s to complete sometimes causing test timeouts. With 16x8=128 tests
|
|
# Postgres tends not to choke.
|
|
NUM_PARALLEL_PACKAGES=8
|
|
NUM_PARALLEL_TESTS=16
|
|
elif [ "${{ runner.os }}" == "macOS" ]; then
|
|
# Our macOS runners have 8 cores. We set NUM_PARALLEL_TESTS to 16
|
|
# because the tests complete faster and Postgres doesn't choke. It seems
|
|
# that macOS's tmpfs is faster than the one on Windows.
|
|
NUM_PARALLEL_PACKAGES=8
|
|
NUM_PARALLEL_TESTS=16
|
|
elif [ "${{ runner.os }}" == "Linux" ]; then
|
|
# Our Linux runners have 8 cores.
|
|
NUM_PARALLEL_PACKAGES=8
|
|
NUM_PARALLEL_TESTS=8
|
|
fi
|
|
|
|
# by default, run tests with cache
|
|
TESTCOUNT=""
|
|
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
|
|
# on main, run tests without cache
|
|
TESTCOUNT="-count=1"
|
|
fi
|
|
|
|
mkdir -p "$RUNNER_TEMP/sym"
|
|
source scripts/normalize_path.sh
|
|
# terraform gets installed in a random directory, so we need to normalize
|
|
# the path to the terraform binary or a bunch of cached tests will be
|
|
# invalidated. See scripts/normalize_path.sh for more details.
|
|
normalize_path_with_symlinks "$RUNNER_TEMP/sym" "$(dirname $(which terraform))"
|
|
|
|
# We rerun failing tests to counteract flakiness coming from Postgres
|
|
# choking on macOS and Windows sometimes.
|
|
DB=ci gotestsum --rerun-fails=2 --rerun-fails-max-failures=50 \
|
|
--format standard-quiet --packages "./..." \
|
|
-- -timeout=20m -v -p $NUM_PARALLEL_PACKAGES -parallel=$NUM_PARALLEL_TESTS $TESTCOUNT
|
|
|
|
- name: Upload Go Build Cache
|
|
uses: ./.github/actions/test-cache/upload
|
|
with:
|
|
cache-key: ${{ steps.download-go-build-cache.outputs.cache-key }}
|
|
cache-path: ${{ steps.go-paths.outputs.cached-dirs }}
|
|
|
|
- name: Upload Test Cache
|
|
uses: ./.github/actions/test-cache/upload
|
|
with:
|
|
cache-key: ${{ steps.download-cache.outputs.cache-key }}
|
|
|
|
- name: Upload test stats to Datadog
|
|
timeout-minutes: 1
|
|
continue-on-error: true
|
|
uses: ./.github/actions/upload-datadog
|
|
if: success() || failure()
|
|
with:
|
|
api-key: ${{ secrets.DATADOG_API_KEY }}
|
|
|
|
# NOTE: this could instead be defined as a matrix strategy, but we want to
|
|
# only block merging if tests on postgres 13 fail. Using a matrix strategy
|
|
# here makes the check in the above `required` job rather complicated.
|
|
test-go-pg-17:
|
|
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
|
|
needs:
|
|
- changes
|
|
if: needs.changes.outputs.go == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
|
|
# This timeout must be greater than the timeout set by `go test` in
|
|
# `make test-postgres` to ensure we receive a trace of running
|
|
# goroutines. Setting this to the timeout +5m should work quite well
|
|
# even if some of the preceding steps are slow.
|
|
timeout-minutes: 25
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Setup Go
|
|
uses: ./.github/actions/setup-go
|
|
|
|
- name: Setup Terraform
|
|
uses: ./.github/actions/setup-tf
|
|
|
|
- name: Download Test Cache
|
|
id: download-cache
|
|
uses: ./.github/actions/test-cache/download
|
|
with:
|
|
key-prefix: test-go-pg-17-${{ runner.os }}-${{ runner.arch }}
|
|
|
|
- name: Test with PostgreSQL Database
|
|
env:
|
|
POSTGRES_VERSION: "17"
|
|
TS_DEBUG_DISCO: "true"
|
|
TEST_RETRIES: 2
|
|
run: |
|
|
make test-postgres
|
|
|
|
- name: Upload Test Cache
|
|
uses: ./.github/actions/test-cache/upload
|
|
with:
|
|
cache-key: ${{ steps.download-cache.outputs.cache-key }}
|
|
|
|
- name: Upload test stats to Datadog
|
|
timeout-minutes: 1
|
|
continue-on-error: true
|
|
uses: ./.github/actions/upload-datadog
|
|
if: success() || failure()
|
|
with:
|
|
api-key: ${{ secrets.DATADOG_API_KEY }}
|
|
|
|
test-go-race:
|
|
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }}
|
|
needs: changes
|
|
if: needs.changes.outputs.go == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
|
|
timeout-minutes: 25
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Setup Go
|
|
uses: ./.github/actions/setup-go
|
|
|
|
- name: Setup Terraform
|
|
uses: ./.github/actions/setup-tf
|
|
|
|
- name: Download Test Cache
|
|
id: download-cache
|
|
uses: ./.github/actions/test-cache/download
|
|
with:
|
|
key-prefix: test-go-race-${{ runner.os }}-${{ runner.arch }}
|
|
|
|
# We run race tests with reduced parallelism because they use more CPU and we were finding
|
|
# instances where tests appear to hang for multiple seconds, resulting in flaky tests when
|
|
# short timeouts are used.
|
|
# c.f. discussion on https://github.com/coder/coder/pull/15106
|
|
- name: Run Tests
|
|
run: |
|
|
gotestsum --junitfile="gotests.xml" --packages="./..." --rerun-fails=2 --rerun-fails-abort-on-data-race -- -race -parallel 4 -p 4
|
|
|
|
- name: Upload Test Cache
|
|
uses: ./.github/actions/test-cache/upload
|
|
with:
|
|
cache-key: ${{ steps.download-cache.outputs.cache-key }}
|
|
|
|
- name: Upload test stats to Datadog
|
|
timeout-minutes: 1
|
|
continue-on-error: true
|
|
uses: ./.github/actions/upload-datadog
|
|
if: always()
|
|
with:
|
|
api-key: ${{ secrets.DATADOG_API_KEY }}
|
|
|
|
test-go-race-pg:
|
|
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }}
|
|
needs: changes
|
|
if: needs.changes.outputs.go == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
|
|
timeout-minutes: 25
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Setup Go
|
|
uses: ./.github/actions/setup-go
|
|
|
|
- name: Setup Terraform
|
|
uses: ./.github/actions/setup-tf
|
|
|
|
- name: Download Test Cache
|
|
id: download-cache
|
|
uses: ./.github/actions/test-cache/download
|
|
with:
|
|
key-prefix: test-go-race-pg-${{ runner.os }}-${{ runner.arch }}
|
|
|
|
# We run race tests with reduced parallelism because they use more CPU and we were finding
|
|
# instances where tests appear to hang for multiple seconds, resulting in flaky tests when
|
|
# short timeouts are used.
|
|
# c.f. discussion on https://github.com/coder/coder/pull/15106
|
|
- name: Run Tests
|
|
env:
|
|
POSTGRES_VERSION: "17"
|
|
run: |
|
|
make test-postgres-docker
|
|
DB=ci gotestsum --junitfile="gotests.xml" --packages="./..." --rerun-fails=2 --rerun-fails-abort-on-data-race -- -race -parallel 4 -p 4
|
|
|
|
- name: Upload Test Cache
|
|
uses: ./.github/actions/test-cache/upload
|
|
with:
|
|
cache-key: ${{ steps.download-cache.outputs.cache-key }}
|
|
|
|
- name: Upload test stats to Datadog
|
|
timeout-minutes: 1
|
|
continue-on-error: true
|
|
uses: ./.github/actions/upload-datadog
|
|
if: always()
|
|
with:
|
|
api-key: ${{ secrets.DATADOG_API_KEY }}
|
|
|
|
# Tailnet integration tests only run when the `tailnet` directory or `go.sum`
|
|
# and `go.mod` are changed. These tests are to ensure we don't add regressions
|
|
# to tailnet, either due to our code or due to updating dependencies.
|
|
#
|
|
# These tests are skipped in the main go test jobs because they require root
|
|
# and mess with networking.
|
|
test-go-tailnet-integration:
|
|
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
|
|
needs: changes
|
|
# Unnecessary to run on main for now
|
|
if: needs.changes.outputs.tailnet-integration == 'true' || needs.changes.outputs.ci == 'true'
|
|
timeout-minutes: 20
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Setup Go
|
|
uses: ./.github/actions/setup-go
|
|
|
|
# Used by some integration tests.
|
|
- name: Install Nginx
|
|
run: sudo apt-get update && sudo apt-get install -y nginx
|
|
|
|
- name: Run Tests
|
|
run: make test-tailnet-integration
|
|
|
|
test-js:
|
|
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
|
|
needs: changes
|
|
if: needs.changes.outputs.site == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
|
|
timeout-minutes: 20
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Setup Node
|
|
uses: ./.github/actions/setup-node
|
|
|
|
- run: pnpm test:ci --max-workers $(nproc)
|
|
working-directory: site
|
|
|
|
test-e2e:
|
|
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-4' || 'ubuntu-latest' }}
|
|
needs: changes
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
variant:
|
|
- premium: false
|
|
name: test-e2e
|
|
#- premium: true
|
|
# name: test-e2e-premium
|
|
# Skip test-e2e on forks as they don't have access to CI secrets
|
|
if: (needs.changes.outputs.go == 'true' || needs.changes.outputs.site == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main') && !(github.event.pull_request.head.repo.fork)
|
|
timeout-minutes: 20
|
|
name: ${{ matrix.variant.name }}
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Setup Node
|
|
uses: ./.github/actions/setup-node
|
|
|
|
- name: Setup Go
|
|
uses: ./.github/actions/setup-go
|
|
|
|
# Assume that the checked-in versions are up-to-date
|
|
- run: make gen/mark-fresh
|
|
name: make gen
|
|
|
|
- run: make site/e2e/bin/coder
|
|
name: make coder
|
|
|
|
- run: pnpm build
|
|
env:
|
|
NODE_OPTIONS: ${{ github.repository_owner == 'coder' && '--max_old_space_size=8192' || '' }}
|
|
working-directory: site
|
|
|
|
- run: pnpm playwright:install
|
|
working-directory: site
|
|
|
|
# Run tests that don't require a premium license without a premium license
|
|
- run: pnpm playwright:test --forbid-only --workers 1
|
|
if: ${{ !matrix.variant.premium }}
|
|
env:
|
|
DEBUG: pw:api
|
|
CODER_E2E_TEST_RETRIES: 2
|
|
working-directory: site
|
|
|
|
# Run all of the tests with a premium license
|
|
- run: pnpm playwright:test --forbid-only --workers 1
|
|
if: ${{ matrix.variant.premium }}
|
|
env:
|
|
DEBUG: pw:api
|
|
CODER_E2E_LICENSE: ${{ secrets.CODER_E2E_LICENSE }}
|
|
CODER_E2E_REQUIRE_PREMIUM_TESTS: "1"
|
|
CODER_E2E_TEST_RETRIES: 2
|
|
working-directory: site
|
|
|
|
- name: Upload Playwright Failed Tests
|
|
if: always() && github.actor != 'dependabot[bot]' && runner.os == 'Linux' && !github.event.pull_request.head.repo.fork
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
with:
|
|
name: failed-test-videos${{ matrix.variant.premium && '-premium' || '' }}
|
|
path: ./site/test-results/**/*.webm
|
|
retention-days: 7
|
|
|
|
- name: Upload pprof dumps
|
|
if: always() && github.actor != 'dependabot[bot]' && runner.os == 'Linux' && !github.event.pull_request.head.repo.fork
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
with:
|
|
name: debug-pprof-dumps${{ matrix.variant.premium && '-premium' || '' }}
|
|
path: ./site/test-results/**/debug-pprof-*.txt
|
|
retention-days: 7
|
|
|
|
# Reference guide:
|
|
# https://www.chromatic.com/docs/turbosnap-best-practices/#run-with-caution-when-using-the-pull_request-event
|
|
chromatic:
|
|
# REMARK: this is only used to build storybook and deploy it to Chromatic.
|
|
runs-on: ubuntu-latest
|
|
needs: changes
|
|
if: needs.changes.outputs.site == 'true' || needs.changes.outputs.ci == 'true'
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
# 👇 Ensures Chromatic can read your full git history
|
|
fetch-depth: 0
|
|
# 👇 Tells the checkout which commit hash to reference
|
|
ref: ${{ github.event.pull_request.head.ref }}
|
|
|
|
- name: Setup Node
|
|
uses: ./.github/actions/setup-node
|
|
|
|
# This step is not meant for mainline because any detected changes to
|
|
# storybook snapshots will require manual approval/review in order for
|
|
# the check to pass. This is desired in PRs, but not in mainline.
|
|
- name: Publish to Chromatic (non-mainline)
|
|
if: github.ref != 'refs/heads/main' && github.repository_owner == 'coder'
|
|
uses: chromaui/action@c50adf8eaa8c2878af3263499a73077854de39d4 # v12.2.0
|
|
env:
|
|
NODE_OPTIONS: "--max_old_space_size=4096"
|
|
STORYBOOK: true
|
|
with:
|
|
# Do a fast, testing build for change previews
|
|
buildScriptName: "storybook:ci"
|
|
exitOnceUploaded: true
|
|
# This will prevent CI from failing when Chromatic detects visual changes
|
|
exitZeroOnChanges: true
|
|
# Chromatic states its fine to make this token public. See:
|
|
# https://www.chromatic.com/docs/github-actions#forked-repositories
|
|
projectToken: 695c25b6cb65
|
|
workingDir: "./site"
|
|
storybookBaseDir: "./site"
|
|
storybookConfigDir: "./site/.storybook"
|
|
# Prevent excessive build runs on minor version changes
|
|
skip: "@(renovate/**|dependabot/**)"
|
|
# Run TurboSnap to trace file dependencies to related stories
|
|
# and tell chromatic to only take snapshots of relevant stories
|
|
onlyChanged: true
|
|
# Avoid uploading single files, because that's very slow
|
|
zip: true
|
|
|
|
# This is a separate step for mainline only that auto accepts and changes
|
|
# instead of holding CI up. Since we squash/merge, this is defensive to
|
|
# avoid the same changeset from requiring review once squashed into
|
|
# main. Chromatic is supposed to be able to detect that we use squash
|
|
# commits, but it's good to be defensive in case, otherwise CI remains
|
|
# infinitely "in progress" in mainline unless we re-review each build.
|
|
- name: Publish to Chromatic (mainline)
|
|
if: github.ref == 'refs/heads/main' && github.repository_owner == 'coder'
|
|
uses: chromaui/action@c50adf8eaa8c2878af3263499a73077854de39d4 # v12.2.0
|
|
env:
|
|
NODE_OPTIONS: "--max_old_space_size=4096"
|
|
STORYBOOK: true
|
|
with:
|
|
autoAcceptChanges: true
|
|
# This will prevent CI from failing when Chromatic detects visual changes
|
|
exitZeroOnChanges: true
|
|
# Do a full build with documentation for mainline builds
|
|
buildScriptName: "storybook:build"
|
|
projectToken: 695c25b6cb65
|
|
workingDir: "./site"
|
|
storybookBaseDir: "./site"
|
|
storybookConfigDir: "./site/.storybook"
|
|
# Run TurboSnap to trace file dependencies to related stories
|
|
# and tell chromatic to only take snapshots of relevant stories
|
|
onlyChanged: true
|
|
# Avoid uploading single files, because that's very slow
|
|
zip: true
|
|
|
|
offlinedocs:
|
|
name: offlinedocs
|
|
needs: changes
|
|
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
|
|
if: needs.changes.outputs.offlinedocs == 'true' || needs.changes.outputs.ci == 'true' || needs.changes.outputs.docs == 'true'
|
|
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
# 0 is required here for version.sh to work.
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Node
|
|
uses: ./.github/actions/setup-node
|
|
with:
|
|
directory: offlinedocs
|
|
|
|
- name: Install Protoc
|
|
run: |
|
|
mkdir -p /tmp/proto
|
|
pushd /tmp/proto
|
|
curl -L -o protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v23.4/protoc-23.4-linux-x86_64.zip
|
|
unzip protoc.zip
|
|
cp -r ./bin/* /usr/local/bin
|
|
cp -r ./include /usr/local/bin/include
|
|
popd
|
|
|
|
- name: Setup Go
|
|
uses: ./.github/actions/setup-go
|
|
|
|
- name: Install go tools
|
|
uses: ./.github/actions/setup-go-tools
|
|
|
|
- name: Setup sqlc
|
|
uses: ./.github/actions/setup-sqlc
|
|
|
|
- name: Format
|
|
run: |
|
|
cd offlinedocs
|
|
pnpm format:check
|
|
|
|
- name: Lint
|
|
run: |
|
|
cd offlinedocs
|
|
pnpm lint
|
|
|
|
- name: Build
|
|
# no `-j` flag as `make` fails with:
|
|
# coderd/rbac/object_gen.go:1:1: syntax error: package statement must be first
|
|
run: |
|
|
make build/coder_docs_"$(./scripts/version.sh)".tgz
|
|
|
|
required:
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- fmt
|
|
- lint
|
|
- gen
|
|
- test-go
|
|
- test-go-pg
|
|
- test-go-race
|
|
- test-go-race-pg
|
|
- test-js
|
|
- test-e2e
|
|
- offlinedocs
|
|
- sqlc-vet
|
|
# Allow this job to run even if the needed jobs fail, are skipped or
|
|
# cancelled.
|
|
if: always()
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- name: Ensure required checks
|
|
run: |
|
|
echo "Checking required checks"
|
|
echo "- fmt: ${{ needs.fmt.result }}"
|
|
echo "- lint: ${{ needs.lint.result }}"
|
|
echo "- gen: ${{ needs.gen.result }}"
|
|
echo "- test-go: ${{ needs.test-go.result }}"
|
|
echo "- test-go-pg: ${{ needs.test-go-pg.result }}"
|
|
echo "- test-go-race: ${{ needs.test-go-race.result }}"
|
|
echo "- test-go-race-pg: ${{ needs.test-go-race-pg.result }}"
|
|
echo "- test-js: ${{ needs.test-js.result }}"
|
|
echo "- test-e2e: ${{ needs.test-e2e.result }}"
|
|
echo "- offlinedocs: ${{ needs.offlinedocs.result }}"
|
|
echo
|
|
|
|
# We allow skipped jobs to pass, but not failed or cancelled jobs.
|
|
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" || "${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
|
|
echo "One of the required checks has failed or has been cancelled"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Required checks have passed"
|
|
|
|
# Builds the dylibs and upload it as an artifact so it can be embedded in the main build
|
|
build-dylib:
|
|
needs: changes
|
|
# We always build the dylibs on Go changes to verify we're not merging unbuildable code,
|
|
# but they need only be signed and uploaded on coder/coder main.
|
|
if: needs.changes.outputs.go == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
|
|
runs-on: ${{ github.repository_owner == 'coder' && 'depot-macos-latest' || 'macos-latest' }}
|
|
steps:
|
|
# Harden Runner doesn't work on macOS
|
|
- name: Checkout
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup build tools
|
|
run: |
|
|
brew install bash gnu-getopt make
|
|
echo "$(brew --prefix bash)/bin" >> $GITHUB_PATH
|
|
echo "$(brew --prefix gnu-getopt)/bin" >> $GITHUB_PATH
|
|
echo "$(brew --prefix make)/libexec/gnubin" >> $GITHUB_PATH
|
|
|
|
- name: Switch XCode Version
|
|
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
|
|
with:
|
|
xcode-version: "16.0.0"
|
|
|
|
- name: Setup Go
|
|
uses: ./.github/actions/setup-go
|
|
|
|
- name: Install rcodesign
|
|
if: ${{ github.repository_owner == 'coder' && github.ref == 'refs/heads/main' }}
|
|
run: |
|
|
set -euo pipefail
|
|
wget -O /tmp/rcodesign.tar.gz https://github.com/indygreg/apple-platform-rs/releases/download/apple-codesign%2F0.22.0/apple-codesign-0.22.0-macos-universal.tar.gz
|
|
sudo tar -xzf /tmp/rcodesign.tar.gz \
|
|
-C /usr/local/bin \
|
|
--strip-components=1 \
|
|
apple-codesign-0.22.0-macos-universal/rcodesign
|
|
rm /tmp/rcodesign.tar.gz
|
|
|
|
- name: Setup Apple Developer certificate and API key
|
|
if: ${{ github.repository_owner == 'coder' && github.ref == 'refs/heads/main' }}
|
|
run: |
|
|
set -euo pipefail
|
|
touch /tmp/{apple_cert.p12,apple_cert_password.txt,apple_apikey.p8}
|
|
chmod 600 /tmp/{apple_cert.p12,apple_cert_password.txt,apple_apikey.p8}
|
|
echo "$AC_CERTIFICATE_P12_BASE64" | base64 -d > /tmp/apple_cert.p12
|
|
echo "$AC_CERTIFICATE_PASSWORD" > /tmp/apple_cert_password.txt
|
|
echo "$AC_APIKEY_P8_BASE64" | base64 -d > /tmp/apple_apikey.p8
|
|
env:
|
|
AC_CERTIFICATE_P12_BASE64: ${{ secrets.AC_CERTIFICATE_P12_BASE64 }}
|
|
AC_CERTIFICATE_PASSWORD: ${{ secrets.AC_CERTIFICATE_PASSWORD }}
|
|
AC_APIKEY_P8_BASE64: ${{ secrets.AC_APIKEY_P8_BASE64 }}
|
|
|
|
- name: Build dylibs
|
|
run: |
|
|
set -euxo pipefail
|
|
go mod download
|
|
|
|
make gen/mark-fresh
|
|
make build/coder-dylib
|
|
env:
|
|
CODER_SIGN_DARWIN: ${{ github.ref == 'refs/heads/main' && '1' || '0' }}
|
|
AC_CERTIFICATE_FILE: /tmp/apple_cert.p12
|
|
AC_CERTIFICATE_PASSWORD_FILE: /tmp/apple_cert_password.txt
|
|
|
|
- name: Upload build artifacts
|
|
if: ${{ github.repository_owner == 'coder' && github.ref == 'refs/heads/main' }}
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
with:
|
|
name: dylibs
|
|
path: |
|
|
./build/*.h
|
|
./build/*.dylib
|
|
retention-days: 7
|
|
|
|
- name: Delete Apple Developer certificate and API key
|
|
if: ${{ github.repository_owner == 'coder' && github.ref == 'refs/heads/main' }}
|
|
run: rm -f /tmp/{apple_cert.p12,apple_cert_password.txt,apple_apikey.p8}
|
|
|
|
build:
|
|
# This builds and publishes ghcr.io/coder/coder-preview:main for each commit
|
|
# to main branch.
|
|
needs:
|
|
- changes
|
|
- build-dylib
|
|
if: github.ref == 'refs/heads/main' && needs.changes.outputs.docs-only == 'false' && !github.event.pull_request.head.repo.fork
|
|
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-22.04' }}
|
|
permissions:
|
|
# Necessary to push docker images to ghcr.io.
|
|
packages: write
|
|
# Necessary for GCP authentication (https://github.com/google-github-actions/setup-gcloud#usage)
|
|
# Also necessary for keyless cosign (https://docs.sigstore.dev/cosign/signing/overview/)
|
|
# And for GitHub Actions attestation
|
|
id-token: write
|
|
# Required for GitHub Actions attestation
|
|
attestations: write
|
|
env:
|
|
DOCKER_CLI_EXPERIMENTAL: "enabled"
|
|
outputs:
|
|
IMAGE: ghcr.io/coder/coder-preview:${{ steps.build-docker.outputs.tag }}
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: GHCR Login
|
|
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Setup Node
|
|
uses: ./.github/actions/setup-node
|
|
|
|
- name: Setup Go
|
|
uses: ./.github/actions/setup-go
|
|
|
|
# Necessary for signing Windows binaries.
|
|
- name: Setup Java
|
|
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
|
|
with:
|
|
distribution: "zulu"
|
|
java-version: "11.0"
|
|
|
|
- name: Install go-winres
|
|
run: go install github.com/tc-hib/go-winres@d743268d7ea168077ddd443c4240562d4f5e8c3e # v0.3.3
|
|
|
|
- name: Install nfpm
|
|
run: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.35.1
|
|
|
|
- name: Install zstd
|
|
run: sudo apt-get install -y zstd
|
|
|
|
- name: Install cosign
|
|
uses: ./.github/actions/install-cosign
|
|
|
|
- name: Install syft
|
|
uses: ./.github/actions/install-syft
|
|
|
|
- name: Setup Windows EV Signing Certificate
|
|
run: |
|
|
set -euo pipefail
|
|
touch /tmp/ev_cert.pem
|
|
chmod 600 /tmp/ev_cert.pem
|
|
echo "$EV_SIGNING_CERT" > /tmp/ev_cert.pem
|
|
wget https://github.com/ebourg/jsign/releases/download/6.0/jsign-6.0.jar -O /tmp/jsign-6.0.jar
|
|
env:
|
|
EV_SIGNING_CERT: ${{ secrets.EV_SIGNING_CERT }}
|
|
|
|
# Setup GCloud for signing Windows binaries.
|
|
- name: Authenticate to Google Cloud
|
|
id: gcloud_auth
|
|
uses: google-github-actions/auth@ba79af03959ebeac9769e648f473a284504d9193 # v2.1.10
|
|
with:
|
|
workload_identity_provider: ${{ secrets.GCP_CODE_SIGNING_WORKLOAD_ID_PROVIDER }}
|
|
service_account: ${{ secrets.GCP_CODE_SIGNING_SERVICE_ACCOUNT }}
|
|
token_format: "access_token"
|
|
|
|
- name: Setup GCloud SDK
|
|
uses: google-github-actions/setup-gcloud@77e7a554d41e2ee56fc945c52dfd3f33d12def9a # v2.1.4
|
|
|
|
- name: Download dylibs
|
|
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
|
with:
|
|
name: dylibs
|
|
path: ./build
|
|
|
|
- name: Insert dylibs
|
|
run: |
|
|
mv ./build/*amd64.dylib ./site/out/bin/coder-vpn-darwin-amd64.dylib
|
|
mv ./build/*arm64.dylib ./site/out/bin/coder-vpn-darwin-arm64.dylib
|
|
mv ./build/*arm64.h ./site/out/bin/coder-vpn-darwin-dylib.h
|
|
|
|
- name: Build
|
|
run: |
|
|
set -euxo pipefail
|
|
go mod download
|
|
|
|
version="$(./scripts/version.sh)"
|
|
tag="main-$(echo "$version" | sed 's/+/-/g')"
|
|
echo "tag=$tag" >> $GITHUB_OUTPUT
|
|
|
|
make gen/mark-fresh
|
|
make -j \
|
|
build/coder_linux_{amd64,arm64,armv7} \
|
|
build/coder_"$version"_windows_amd64.zip \
|
|
build/coder_"$version"_linux_amd64.{tar.gz,deb}
|
|
env:
|
|
# The Windows slim binary must be signed for Coder Desktop to accept
|
|
# it. The darwin executables don't need to be signed, but the dylibs
|
|
# do (see above).
|
|
CODER_SIGN_WINDOWS: "1"
|
|
CODER_WINDOWS_RESOURCES: "1"
|
|
EV_KEY: ${{ secrets.EV_KEY }}
|
|
EV_KEYSTORE: ${{ secrets.EV_KEYSTORE }}
|
|
EV_TSA_URL: ${{ secrets.EV_TSA_URL }}
|
|
EV_CERTIFICATE_PATH: /tmp/ev_cert.pem
|
|
GCLOUD_ACCESS_TOKEN: ${{ steps.gcloud_auth.outputs.access_token }}
|
|
JSIGN_PATH: /tmp/jsign-6.0.jar
|
|
|
|
- name: Build Linux Docker images
|
|
id: build-docker
|
|
env:
|
|
CODER_IMAGE_BASE: ghcr.io/coder/coder-preview
|
|
CODER_IMAGE_TAG_PREFIX: main
|
|
DOCKER_CLI_EXPERIMENTAL: "enabled"
|
|
run: |
|
|
set -euxo pipefail
|
|
|
|
# build Docker images for each architecture
|
|
version="$(./scripts/version.sh)"
|
|
tag="main-$(echo "$version" | sed 's/+/-/g')"
|
|
echo "tag=$tag" >> $GITHUB_OUTPUT
|
|
|
|
# build images for each architecture
|
|
# note: omitting the -j argument to avoid race conditions when pushing
|
|
make build/coder_"$version"_linux_{amd64,arm64,armv7}.tag
|
|
|
|
# only push if we are on main branch
|
|
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
|
|
# build and push multi-arch manifest, this depends on the other images
|
|
# being pushed so will automatically push them
|
|
# note: omitting the -j argument to avoid race conditions when pushing
|
|
make push/build/coder_"$version"_linux_{amd64,arm64,armv7}.tag
|
|
|
|
# Define specific tags
|
|
tags=("$tag" "main" "latest")
|
|
|
|
# Create and push a multi-arch manifest for each tag
|
|
# we are adding `latest` tag and keeping `main` for backward
|
|
# compatibality
|
|
for t in "${tags[@]}"; do
|
|
./scripts/build_docker_multiarch.sh \
|
|
--push \
|
|
--target "ghcr.io/coder/coder-preview:$t" \
|
|
--version $version \
|
|
$(cat build/coder_"$version"_linux_{amd64,arm64,armv7}.tag)
|
|
done
|
|
fi
|
|
|
|
- name: SBOM Generation and Attestation
|
|
if: github.ref == 'refs/heads/main'
|
|
continue-on-error: true
|
|
env:
|
|
COSIGN_EXPERIMENTAL: 1
|
|
run: |
|
|
set -euxo pipefail
|
|
|
|
# Define image base and tags
|
|
IMAGE_BASE="ghcr.io/coder/coder-preview"
|
|
TAGS=("${{ steps.build-docker.outputs.tag }}" "main" "latest")
|
|
|
|
# Generate and attest SBOM for each tag
|
|
for tag in "${TAGS[@]}"; do
|
|
IMAGE="${IMAGE_BASE}:${tag}"
|
|
SBOM_FILE="coder_sbom_${tag//[:\/]/_}.spdx.json"
|
|
|
|
echo "Generating SBOM for image: ${IMAGE}"
|
|
syft "${IMAGE}" -o spdx-json > "${SBOM_FILE}"
|
|
|
|
echo "Attesting SBOM to image: ${IMAGE}"
|
|
cosign clean --force=true "${IMAGE}"
|
|
cosign attest --type spdxjson \
|
|
--predicate "${SBOM_FILE}" \
|
|
--yes \
|
|
"${IMAGE}"
|
|
done
|
|
|
|
# GitHub attestation provides SLSA provenance for the Docker images, establishing a verifiable
|
|
# record that these images were built in GitHub Actions with specific inputs and environment.
|
|
# This complements our existing cosign attestations which focus on SBOMs.
|
|
#
|
|
# We attest each tag separately to ensure all tags have proper provenance records.
|
|
# TODO: Consider refactoring these steps to use a matrix strategy or composite action to reduce duplication
|
|
# while maintaining the required functionality for each tag.
|
|
- name: GitHub Attestation for Docker image
|
|
id: attest_main
|
|
if: github.ref == 'refs/heads/main'
|
|
continue-on-error: true
|
|
uses: actions/attest@ce27ba3b4a9a139d9a20a4a07d69fabb52f1e5bc # v2.4.0
|
|
with:
|
|
subject-name: "ghcr.io/coder/coder-preview:main"
|
|
predicate-type: "https://slsa.dev/provenance/v1"
|
|
predicate: |
|
|
{
|
|
"buildType": "https://github.com/actions/runner-images/",
|
|
"builder": {
|
|
"id": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
|
},
|
|
"invocation": {
|
|
"configSource": {
|
|
"uri": "git+https://github.com/${{ github.repository }}@${{ github.ref }}",
|
|
"digest": {
|
|
"sha1": "${{ github.sha }}"
|
|
},
|
|
"entryPoint": ".github/workflows/ci.yaml"
|
|
},
|
|
"environment": {
|
|
"github_workflow": "${{ github.workflow }}",
|
|
"github_run_id": "${{ github.run_id }}"
|
|
}
|
|
},
|
|
"metadata": {
|
|
"buildInvocationID": "${{ github.run_id }}",
|
|
"completeness": {
|
|
"environment": true,
|
|
"materials": true
|
|
}
|
|
}
|
|
}
|
|
push-to-registry: true
|
|
|
|
- name: GitHub Attestation for Docker image (latest tag)
|
|
id: attest_latest
|
|
if: github.ref == 'refs/heads/main'
|
|
continue-on-error: true
|
|
uses: actions/attest@ce27ba3b4a9a139d9a20a4a07d69fabb52f1e5bc # v2.4.0
|
|
with:
|
|
subject-name: "ghcr.io/coder/coder-preview:latest"
|
|
predicate-type: "https://slsa.dev/provenance/v1"
|
|
predicate: |
|
|
{
|
|
"buildType": "https://github.com/actions/runner-images/",
|
|
"builder": {
|
|
"id": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
|
},
|
|
"invocation": {
|
|
"configSource": {
|
|
"uri": "git+https://github.com/${{ github.repository }}@${{ github.ref }}",
|
|
"digest": {
|
|
"sha1": "${{ github.sha }}"
|
|
},
|
|
"entryPoint": ".github/workflows/ci.yaml"
|
|
},
|
|
"environment": {
|
|
"github_workflow": "${{ github.workflow }}",
|
|
"github_run_id": "${{ github.run_id }}"
|
|
}
|
|
},
|
|
"metadata": {
|
|
"buildInvocationID": "${{ github.run_id }}",
|
|
"completeness": {
|
|
"environment": true,
|
|
"materials": true
|
|
}
|
|
}
|
|
}
|
|
push-to-registry: true
|
|
|
|
- name: GitHub Attestation for version-specific Docker image
|
|
id: attest_version
|
|
if: github.ref == 'refs/heads/main'
|
|
continue-on-error: true
|
|
uses: actions/attest@ce27ba3b4a9a139d9a20a4a07d69fabb52f1e5bc # v2.4.0
|
|
with:
|
|
subject-name: "ghcr.io/coder/coder-preview:${{ steps.build-docker.outputs.tag }}"
|
|
predicate-type: "https://slsa.dev/provenance/v1"
|
|
predicate: |
|
|
{
|
|
"buildType": "https://github.com/actions/runner-images/",
|
|
"builder": {
|
|
"id": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
|
},
|
|
"invocation": {
|
|
"configSource": {
|
|
"uri": "git+https://github.com/${{ github.repository }}@${{ github.ref }}",
|
|
"digest": {
|
|
"sha1": "${{ github.sha }}"
|
|
},
|
|
"entryPoint": ".github/workflows/ci.yaml"
|
|
},
|
|
"environment": {
|
|
"github_workflow": "${{ github.workflow }}",
|
|
"github_run_id": "${{ github.run_id }}"
|
|
}
|
|
},
|
|
"metadata": {
|
|
"buildInvocationID": "${{ github.run_id }}",
|
|
"completeness": {
|
|
"environment": true,
|
|
"materials": true
|
|
}
|
|
}
|
|
}
|
|
push-to-registry: true
|
|
|
|
# Report attestation failures but don't fail the workflow
|
|
- name: Check attestation status
|
|
if: github.ref == 'refs/heads/main'
|
|
run: |
|
|
if [[ "${{ steps.attest_main.outcome }}" == "failure" ]]; then
|
|
echo "::warning::GitHub attestation for main tag failed"
|
|
fi
|
|
if [[ "${{ steps.attest_latest.outcome }}" == "failure" ]]; then
|
|
echo "::warning::GitHub attestation for latest tag failed"
|
|
fi
|
|
if [[ "${{ steps.attest_version.outcome }}" == "failure" ]]; then
|
|
echo "::warning::GitHub attestation for version-specific tag failed"
|
|
fi
|
|
|
|
- name: Prune old images
|
|
if: github.ref == 'refs/heads/main'
|
|
uses: vlaurin/action-ghcr-prune@0cf7d39f88546edd31965acba78cdcb0be14d641 # v0.6.0
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
organization: coder
|
|
container: coder-preview
|
|
keep-younger-than: 7 # days
|
|
keep-tags: latest
|
|
keep-tags-regexes: ^pr
|
|
prune-tags-regexes: |
|
|
^main-
|
|
^v
|
|
prune-untagged: true
|
|
|
|
- name: Upload build artifacts
|
|
if: github.ref == 'refs/heads/main'
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
with:
|
|
name: coder
|
|
path: |
|
|
./build/*.zip
|
|
./build/*.tar.gz
|
|
./build/*.deb
|
|
retention-days: 7
|
|
|
|
deploy:
|
|
name: "deploy"
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
needs:
|
|
- changes
|
|
- build
|
|
if: |
|
|
github.ref == 'refs/heads/main' && !github.event.pull_request.head.repo.fork
|
|
&& needs.changes.outputs.docs-only == 'false'
|
|
permissions:
|
|
contents: read
|
|
id-token: write
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Authenticate to Google Cloud
|
|
uses: google-github-actions/auth@ba79af03959ebeac9769e648f473a284504d9193 # v2.1.10
|
|
with:
|
|
workload_identity_provider: projects/573722524737/locations/global/workloadIdentityPools/github/providers/github
|
|
service_account: coder-ci@coder-dogfood.iam.gserviceaccount.com
|
|
|
|
- name: Set up Google Cloud SDK
|
|
uses: google-github-actions/setup-gcloud@77e7a554d41e2ee56fc945c52dfd3f33d12def9a # v2.1.4
|
|
|
|
- name: Set up Flux CLI
|
|
uses: fluxcd/flux2/action@b73c7f7191086ca7629840e680e71873349787f8 # v2.6.1
|
|
with:
|
|
# Keep this and the github action up to date with the version of flux installed in dogfood cluster
|
|
version: "2.5.1"
|
|
|
|
- name: Get Cluster Credentials
|
|
uses: google-github-actions/get-gke-credentials@d0cee45012069b163a631894b98904a9e6723729 # v2.3.3
|
|
with:
|
|
cluster_name: dogfood-v2
|
|
location: us-central1-a
|
|
project_id: coder-dogfood-v2
|
|
|
|
- name: Reconcile Flux
|
|
run: |
|
|
set -euxo pipefail
|
|
flux --namespace flux-system reconcile source git flux-system
|
|
flux --namespace flux-system reconcile source git coder-main
|
|
flux --namespace flux-system reconcile kustomization flux-system
|
|
flux --namespace flux-system reconcile kustomization coder
|
|
flux --namespace flux-system reconcile source chart coder-coder
|
|
flux --namespace flux-system reconcile source chart coder-coder-provisioner
|
|
flux --namespace coder reconcile helmrelease coder
|
|
flux --namespace coder reconcile helmrelease coder-provisioner
|
|
|
|
# Just updating Flux is usually not enough. The Helm release may get
|
|
# redeployed, but unless something causes the Deployment to update the
|
|
# pods won't be recreated. It's important that the pods get recreated,
|
|
# since we use `imagePullPolicy: Always` to ensure we're running the
|
|
# latest image.
|
|
- name: Rollout Deployment
|
|
run: |
|
|
set -euxo pipefail
|
|
kubectl --namespace coder rollout restart deployment/coder
|
|
kubectl --namespace coder rollout status deployment/coder
|
|
kubectl --namespace coder rollout restart deployment/coder-provisioner
|
|
kubectl --namespace coder rollout status deployment/coder-provisioner
|
|
kubectl --namespace coder rollout restart deployment/coder-provisioner-tagged
|
|
kubectl --namespace coder rollout status deployment/coder-provisioner-tagged
|
|
|
|
deploy-wsproxies:
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
if: github.ref == 'refs/heads/main' && !github.event.pull_request.head.repo.fork
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup flyctl
|
|
uses: superfly/flyctl-actions/setup-flyctl@fc53c09e1bc3be6f54706524e3b82c4f462f77be # v1.5
|
|
|
|
- name: Deploy workspace proxies
|
|
run: |
|
|
flyctl deploy --image "$IMAGE" --app paris-coder --config ./.github/fly-wsproxies/paris-coder.toml --env "CODER_PROXY_SESSION_TOKEN=$TOKEN_PARIS" --yes
|
|
flyctl deploy --image "$IMAGE" --app sydney-coder --config ./.github/fly-wsproxies/sydney-coder.toml --env "CODER_PROXY_SESSION_TOKEN=$TOKEN_SYDNEY" --yes
|
|
flyctl deploy --image "$IMAGE" --app sao-paulo-coder --config ./.github/fly-wsproxies/sao-paulo-coder.toml --env "CODER_PROXY_SESSION_TOKEN=$TOKEN_SAO_PAULO" --yes
|
|
flyctl deploy --image "$IMAGE" --app jnb-coder --config ./.github/fly-wsproxies/jnb-coder.toml --env "CODER_PROXY_SESSION_TOKEN=$TOKEN_JNB" --yes
|
|
env:
|
|
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
|
|
IMAGE: ${{ needs.build.outputs.IMAGE }}
|
|
TOKEN_PARIS: ${{ secrets.FLY_PARIS_CODER_PROXY_SESSION_TOKEN }}
|
|
TOKEN_SYDNEY: ${{ secrets.FLY_SYDNEY_CODER_PROXY_SESSION_TOKEN }}
|
|
TOKEN_SAO_PAULO: ${{ secrets.FLY_SAO_PAULO_CODER_PROXY_SESSION_TOKEN }}
|
|
TOKEN_JNB: ${{ secrets.FLY_JNB_CODER_PROXY_SESSION_TOKEN }}
|
|
|
|
# sqlc-vet runs a postgres docker container, runs Coder migrations, and then
|
|
# runs sqlc-vet to ensure all queries are valid. This catches any mistakes
|
|
# in migrations or sqlc queries that makes a query unable to be prepared.
|
|
sqlc-vet:
|
|
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
|
|
needs: changes
|
|
if: needs.changes.outputs.db == 'true' || needs.changes.outputs.ci == 'true' || github.ref == 'refs/heads/main'
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
fetch-depth: 1
|
|
# We need golang to run the migration main.go
|
|
- name: Setup Go
|
|
uses: ./.github/actions/setup-go
|
|
|
|
- name: Setup sqlc
|
|
uses: ./.github/actions/setup-sqlc
|
|
|
|
- name: Setup and run sqlc vet
|
|
run: |
|
|
make sqlc-vet
|
|
|
|
notify-slack-on-failure:
|
|
needs:
|
|
- required
|
|
runs-on: ubuntu-latest
|
|
if: failure() && github.ref == 'refs/heads/main'
|
|
|
|
steps:
|
|
- name: Send Slack notification
|
|
run: |
|
|
curl -X POST -H 'Content-type: application/json' \
|
|
--data '{
|
|
"blocks": [
|
|
{
|
|
"type": "header",
|
|
"text": {
|
|
"type": "plain_text",
|
|
"text": "❌ CI Failure in main",
|
|
"emoji": true
|
|
}
|
|
},
|
|
{
|
|
"type": "section",
|
|
"fields": [
|
|
{
|
|
"type": "mrkdwn",
|
|
"text": "*Workflow:*\n${{ github.workflow }}"
|
|
},
|
|
{
|
|
"type": "mrkdwn",
|
|
"text": "*Committer:*\n${{ github.actor }}"
|
|
},
|
|
{
|
|
"type": "mrkdwn",
|
|
"text": "*Commit:*\n${{ github.sha }}"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "section",
|
|
"text": {
|
|
"type": "mrkdwn",
|
|
"text": "*View failure:* <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|Click here>"
|
|
}
|
|
}
|
|
]
|
|
}' ${{ secrets.CI_FAILURE_SLACK_WEBHOOK }}
|