Skip to content

Commit

Permalink
chore: turbo tweaks (#3701)
Browse files Browse the repository at this point in the history
- added caching for wingsdk post-compile by handling the convulated doc copying thing
- added caching for packaging by making the `output` of `package` the shared dist dir
- added cargo workspace back
- made sure tests that depend on the examples (winglang, hangar, and wingc) all invalidate their cache when those examples change
- added self-mutation back in for the test job
- Use the `topo` convention to group some inputs together
- Tweak several configs to hopefully improve general caching

*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
MarkMcCulloh authored Aug 4, 2023
1 parent 52fdcb3 commit 845b592
Show file tree
Hide file tree
Showing 45 changed files with 241 additions and 600 deletions.
20 changes: 19 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
run: pnpm changelog

- name: Build and Package
run: pnpm build:ci
run: pnpm package:ci
env:
SEGMENT_WRITE_KEY: ${{ secrets.SEGMENT_WRITE_KEY }}

Expand Down Expand Up @@ -169,6 +169,24 @@ jobs:
- name: Test
run: pnpm test:ci

- name: Create git patch
id: diff
run: |
git add --all
git diff --staged --binary --patch > build.diff
if [ -s build.diff ]; then
echo "Diff found, creating a patch to apply later"
cat build.diff
echo "diff=true" >> $GITHUB_OUTPUT
fi
- name: Upload patch
if: steps.diff.outputs.diff == 'true'
uses: actions/upload-artifact@v3
with:
name: build.diff
path: build.diff

benchmark:
name: Benchmark
runs-on: ubuntu-latest
Expand Down
14 changes: 14 additions & 0 deletions libs/wingc/Cargo.lock → Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[workspace]
members = [
"libs/tree-sitter-wing",
"libs/wingc",
"libs/wingii",
]

# For use with `cargo flamegraph --profile flamegraph`
[profile.flamegraph]
inherits = "release"
debug = true
2 changes: 0 additions & 2 deletions apps/jsii-docgen/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions apps/jsii-docgen/.npmignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions apps/jsii-docgen/.projen/deps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

67 changes: 1 addition & 66 deletions apps/jsii-docgen/.projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion apps/jsii-docgen/.projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ const project = new typescript.TypeScriptProject({
"semver",
"yargs@^16",
],
releaseToNpm: true,
packageManager: javascript.NodePackageManager.PNPM,
github: false,
projenrcTs: true,
prettier: true,
release: false,
package: false,
});

const libraryFixtures = ["construct-library"];
Expand Down
4 changes: 0 additions & 4 deletions apps/jsii-docgen/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions apps/jsii-docgen/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
"pipeline": {
"compile": {
"outputs": ["lib/**"]
},
"package": {
"outputs": ["dist/**"]
}
}
}
2 changes: 1 addition & 1 deletion apps/vscode-wing/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"extends": ["//"],
"pipeline": {
"compile": {
"inputs": ["src/**"],
"outputs": ["lib/**"]
},
"dev": {
"dependsOn": ["compile"]
},
"package": {
"inputs": ["syntaxes/**", "resources/**"],
"outputs": ["vscode-wing.vsix"]
}
}
Expand Down
10 changes: 1 addition & 9 deletions apps/wing-api-checker/.projen/tasks.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions apps/wing-api-checker/.projenrc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const project = new typescript.TypeScriptProject({
github: false,
projenrcTs: true,
prettier: true,
package: false,
deps: ["chalk", "chokidar", "glob-promise", "jsii-reflect", "yargs"],
devDeps: ["@types/node@^18", "@types/yargs"],
});
Expand Down
3 changes: 3 additions & 0 deletions apps/wing-console/console/app/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"compile": {
"outputs": ["dist/**"],
"env": ["SEGMENT_WRITE_KEY"]
},
"package": {
"outputs": ["../../../../dist/wingconsole-app-*.tgz"]
}
}
}
3 changes: 3 additions & 0 deletions apps/wing-console/console/design-system/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"pipeline": {
"compile": {
"outputs": ["dist/**"]
},
"package": {
"outputs": ["../../../../dist/wingconsole-design-system-*.tgz"]
}
}
}
3 changes: 3 additions & 0 deletions apps/wing-console/console/server/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"pipeline": {
"compile": {
"outputs": ["dist/**"]
},
"package": {
"outputs": ["../../../../dist/wingconsole-server-*.tgz"]
}
}
}
3 changes: 3 additions & 0 deletions apps/wing-console/console/ui/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"pipeline": {
"compile": {
"outputs": ["dist/**"]
},
"package": {
"outputs": ["../../../../dist/wingconsole-ui-*.tgz"]
}
}
}
3 changes: 0 additions & 3 deletions apps/wing/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// for WebAssembly typings:
/// <reference lib="dom" />

import { satisfies } from "compare-versions";

import { Command, Option } from "commander";
Expand Down
7 changes: 5 additions & 2 deletions apps/wing/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
"$schema": "https://turborepo.org/schema.json",
"extends": ["//"],
"pipeline": {
"test": {
"dependsOn": ["^compile", "examples-valid#topo"]
},
"compile": {
"outputs": ["dist/**"]
},
"test": {
"dependsOn": ["compile"]
"package": {
"outputs": ["../../dist/winglang-*.tgz"]
}
}
}
6 changes: 6 additions & 0 deletions examples/tests/error/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "examples-error",
"volta": {
"extends": "../../../package.json"
}
}
9 changes: 9 additions & 0 deletions examples/tests/error/turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://turborepo.org/schema.json",
"extends": ["//"],
"pipeline": {
"topo": {
"inputs": ["**", "!node_modules/**", "!**/target/**"]
}
}
}
9 changes: 9 additions & 0 deletions examples/tests/invalid/turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://turborepo.org/schema.json",
"extends": ["//"],
"pipeline": {
"topo": {
"inputs": ["**", "!node_modules/**", "!**/target/**"]
}
}
}
2 changes: 1 addition & 1 deletion examples/tests/sdk_tests/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "examples-util",
"name": "examples-sdk",
"dependencies": {
"uuid": "^9.0.0",
"nanoid": "^3.3.6"
Expand Down
9 changes: 9 additions & 0 deletions examples/tests/sdk_tests/turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$schema": "https://turborepo.org/schema.json",
"extends": ["//"],
"pipeline": {
"topo": {
"inputs": ["**", "!node_modules/**", "!**/target/**"]
}
}
}
Loading

0 comments on commit 845b592

Please sign in to comment.