-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(repo): turbo caching improvements and minor packaging simplific…
…ation (#3913) Subset of changes from #3791, avoiding the titular "skip hangar" part. Primary Goal: Tweak turbo configuration to both more granular and more accurate in general Changes: - (turbo) Tests do not effect compile/package output - (turbo) Stop using `src/**` when possible, using more specific file extensions - Make wingc.wasm and docs.tgz part of npm scripts and put the result alongside the other distributables - the github workflow was simplified to be able to just upload/download all these dists - (workflow) Made sure rust only caches in the test workflow, otherwise the build and test workflows fight over the cache - Fixed #3842 by explicitly publishing packages in order. Might do something more robust later, but this at least avoids the out-of-order issue - Deleted several extra license files (projen generated a `LICENSE`, while we had `LICENSE.md` as well) *By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*.
- Loading branch information
1 parent
6a0ebfb
commit b547c18
Showing
23 changed files
with
73 additions
and
349 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,16 +22,15 @@ env: | |
RUST_VERSION: "1.67.1" | ||
NODE_VERSION: "18.16.0" | ||
PNPM_VERSION: "8.6.3" | ||
CARGO_TERM_COLOR: always | ||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | ||
TURBO_TEAM: ${{ vars.TURBO_TEAM }} | ||
|
||
jobs: | ||
build: | ||
name: "Build" | ||
timeout-minutes: 30 | ||
runs-on: ubuntu-latest | ||
env: | ||
CARGO_TERM_COLOR: always | ||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | ||
TURBO_TEAM: ${{ vars.TURBO_TEAM }} | ||
outputs: | ||
version: ${{ fromJson(steps.changelog.outputs.data).newVersion }} | ||
last-version: ${{ fromJson(steps.changelog.outputs.data).lastVersion }} | ||
|
@@ -66,6 +65,9 @@ jobs: | |
|
||
- name: Setup Cargo Cache | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
# Don't save cache here, to avoid thrashing with test job | ||
save-if: false | ||
|
||
- name: Install Dependencies | ||
run: pnpm install --frozen-lockfile | ||
|
@@ -81,18 +83,6 @@ jobs: | |
env: | ||
SEGMENT_WRITE_KEY: ${{ secrets.SEGMENT_WRITE_KEY }} | ||
|
||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: dist | ||
path: dist/*.tgz | ||
|
||
- name: Upload WingC WASM | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: wingc | ||
path: libs/wingcompiler/wingc.wasm | ||
|
||
- name: Derive appropriate SHAs for base and head | ||
id: setSHAs | ||
uses: nrwl/nx-set-shas@v3 | ||
|
@@ -106,35 +96,19 @@ jobs: | |
echo "diff=true" >> "$GITHUB_OUTPUT" | ||
fi | ||
- name: Upload Extension | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: vscode-wing | ||
path: apps/vscode-wing/vscode-wing.vsix | ||
|
||
- name: Compress Docs | ||
run: tar -czvf docs.tgz docs/* | ||
|
||
- name: Upload Docs | ||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: docs | ||
path: docs.tgz | ||
name: dist | ||
path: dist/* | ||
|
||
test: | ||
name: Test | ||
timeout-minutes: 30 | ||
runs-on: ubuntu-latest | ||
env: | ||
CARGO_TERM_COLOR: always | ||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | ||
TURBO_TEAM: ${{ vars.TURBO_TEAM }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Setup pnpm | ||
uses: pnpm/[email protected] | ||
|
@@ -227,7 +201,7 @@ jobs: | |
path: tools/hangar/results/report.json | ||
|
||
- name: Create Markdown report | ||
run: node scripts/benchmark_json_to_table.mjs | ||
run: scripts/benchmark_json_to_table.mjs | ||
|
||
e2e-test: | ||
name: "E2E / ${{ matrix.runner }} + Node${{ matrix.node }} [${{ matrix.shard }}]" | ||
|
@@ -254,8 +228,6 @@ jobs: | |
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
|
||
- name: Setup pnpm | ||
uses: pnpm/[email protected] | ||
|
@@ -349,25 +321,28 @@ jobs: | |
repo-token: "${{ secrets.PROJEN_GITHUB_TOKEN }}" | ||
tag: "v${{ needs.build.outputs.version }}" | ||
|
||
- name: Login to NPM registry | ||
run: npm set //registry.npmjs.org/:_authToken ${{ secrets.NPM_PUBLISH_TOKEN }} | ||
|
||
- name: Publish npm packages | ||
working-directory: dist | ||
env: | ||
PACKAGE_VERSION: ${{ needs.build.outputs.version }} | ||
run: | | ||
PACKAGES=("winglang-sdk" "winglang-compiler" "wingconsole-design-system" "wingconsole-ui" "wingconsole-server" "wingconsole-app") | ||
for PACKAGE in $PACKAGES; do | ||
npm publish "$PACKAGE-$PACKAGE_VERSION.tgz" --access public | ||
done | ||
- name: Publish Extension to Visual Studio Marketplace | ||
if: needs.build.outputs.vscode-wing-changed == 'true' | ||
uses: "HaaLeo/publish-vscode-extension@v1" | ||
with: | ||
pat: ${{ secrets.VS_MARKETPLACE_TOKEN }} | ||
registryUrl: "https://marketplace.visualstudio.com" | ||
extensionFile: "vscode-wing/vscode-wing.vsix" | ||
extensionFile: "dist/vscode-wing.vsix" | ||
dependencies: false | ||
|
||
- name: Login to NPM registry | ||
run: npm set //registry.npmjs.org/:_authToken ${{ secrets.NPM_PUBLISH_TOKEN }} | ||
|
||
- name: Publish npm packages | ||
run: | | ||
for file in *.tgz; do | ||
npm publish "$file" --access public | ||
done | ||
working-directory: dist | ||
|
||
- name: Write Changelog | ||
uses: DamianReeves/[email protected] | ||
with: | ||
|
@@ -377,9 +352,6 @@ jobs: | |
|
||
- name: Compute Checksums | ||
run: | | ||
mv ./docs/*.tgz ./dist | ||
mv ./*/*.vsix ./dist | ||
mv ./*/*.wasm ./dist | ||
mv ./benchmarks/* ./dist | ||
cd dist | ||
|
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.