Skip to content

Commit 3490671

Browse files
committed
Try actually doing something using this new workflow
1 parent cdae9a2 commit 3490671

File tree

3 files changed

+42
-8
lines changed

3 files changed

+42
-8
lines changed

.github/actions/info/dist.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async function findPackages(directory, maxDepth) {
2020
}
2121
continue;
2222
}
23-
if (item.isDirectory() && item.name !== "node_modules") {
23+
if (item.isDirectory() && item.name !== "node_modules" && !item.name.startsWith("__")) {
2424
yield* recurser(fullPath, currentDepth + 1);
2525
}
2626
}
@@ -36,7 +36,7 @@ async function main() {
3636
const packageType = core.getInput("type", { required: true });
3737
let dirPath;
3838
switch (packageType) {
39-
case "lib": {
39+
case "libs": {
4040
dirPath = pathlib.join(gitRoot, "lib");
4141
break;
4242
}
@@ -54,7 +54,7 @@ async function main() {
5454
}
5555
}
5656
const packages = await findPackages(dirPath);
57-
core.setOutput("packages", packages);
57+
core.setOutput(packageType, packages);
5858
core.summary.addHeading(`Found ${packageType}`);
5959
core.summary.addList(packages);
6060
core.summary.write();

.github/actions/info/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ async function findPackages(directory: string, maxDepth?: number) {
2424
continue;
2525
}
2626

27-
if (item.isDirectory() && item.name !== 'node_modules') {
27+
if (item.isDirectory() && item.name !== 'node_modules' && !item.name.startsWith('__')) {
2828
yield* recurser(fullPath, currentDepth + 1);
2929
}
3030
}
@@ -45,7 +45,7 @@ async function main() {
4545

4646
let dirPath: string;
4747
switch (packageType) {
48-
case 'lib': {
48+
case 'libs': {
4949
dirPath = pathlib.join(gitRoot, 'lib');
5050
break;
5151
}
@@ -64,7 +64,7 @@ async function main() {
6464
}
6565

6666
const packages = await findPackages(dirPath);
67-
core.setOutput('packages', packages);
67+
core.setOutput(packageType, packages);
6868
core.summary.addHeading(`Found ${packageType}`);
6969
core.summary.addList(packages);
7070
core.summary.write();

.github/workflows/new-workflow.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
type: ['lib', 'bundles', 'tabs']
17+
type: ['libs', 'bundles', 'tabs']
1818

1919
outputs:
20-
packages: ${{ steps.find.outputs.packages }}
20+
libs: ${{ steps.find.outputs.libs }}
21+
bundles: ${{ steps.find.outputs.bundles }}
22+
tabs: ${{ steps.find.outputs.tabs }}
2123

2224
steps:
2325
- name: Check out source code
@@ -40,3 +42,35 @@ jobs:
4042
uses: ./.github/actions/info
4143
with:
4244
type: ${{ matrix.type }}
45+
46+
test-libs:
47+
name: Test and Typecheck libraries
48+
runs-on: ubuntu-latest
49+
needs: load-packages
50+
strategy:
51+
matrix:
52+
package: ${{ needs.load-packages.outputs.libs }}
53+
54+
steps:
55+
- name: Check out source code
56+
uses: actions/checkout@v4
57+
58+
- name: Enable Corepack
59+
run: corepack enable
60+
61+
- name: Use Node.js 💻
62+
uses: actions/setup-node@v4
63+
with:
64+
node-version-file: .node-version
65+
cache: yarn
66+
67+
- name: Install dependencies
68+
run: yarn workspaces focus ${{ matrix.package }}
69+
70+
- name: tsc and test
71+
run: |
72+
yarn tsc
73+
yarn test
74+
75+
76+

0 commit comments

Comments
 (0)