Skip to content

Commit 35d020c

Browse files
authored
js: Shift to top level dir (#3336)
Signed-off-by: Ryan Northey <ryan@synca.io> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
1 parent 25f75f7 commit 35d020c

File tree

99 files changed

+118
-68
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+118
-68
lines changed

.github/workflows/actions.yml

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
config: |
2828
paths:
2929
- 'gh-actions/**'
30+
- 'js/**'
3031
- '.github/workflows/actions.yml'
3132
- id: tests
3233
uses: envoyproxy/toolshed/gh-actions/bson@3067ae34d13c569fe1651da3346dcba517701000
@@ -57,47 +58,6 @@ jobs:
5758
config: ${{ matrix.test }}
5859
name: ${{ matrix.test }}
5960

60-
js-actions:
61-
runs-on: ubuntu-24.04
62-
needs: request
63-
if: fromJSON(needs.request.outputs.run)
64-
strategy:
65-
fail-fast: false
66-
matrix:
67-
node-version:
68-
- 20.x
69-
name:
70-
- appauth
71-
- dispatch
72-
- github/checks
73-
- github/mutex
74-
- github/script/run
75-
- hashfiles
76-
- jq
77-
- retest
78-
- torun
79-
steps:
80-
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
81-
- name: Use Node.js ${{ matrix.node-version }}
82-
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
83-
with:
84-
node-version: ${{ matrix.node-version }}
85-
- run: npm ci
86-
working-directory: gh-actions/${{ matrix.name }}
87-
- run: npm run lint
88-
working-directory: gh-actions/${{ matrix.name }}
89-
- run: npm test
90-
working-directory: gh-actions/${{ matrix.name }}
91-
- run: |
92-
npm run build
93-
if [[ $(git status --porcelain) ]]; then
94-
echo 'Built javascript does not match, did you run `npm run build`?' >&2
95-
git status
96-
git diff
97-
exit 1
98-
fi
99-
working-directory: gh-actions/${{ matrix.name }}
100-
10161
status:
10262
runs-on: ubuntu-24.04
10363
if: >-
@@ -107,7 +67,6 @@ jobs:
10767
needs:
10868
- request
10969
- actions
110-
- js-actions
11170
steps:
11271
- run: |
11372
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" || "${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then

.github/workflows/js.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: JavaScript CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
permissions:
10+
contents: read
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
14+
cancel-in-progress: true
15+
16+
17+
jobs:
18+
request:
19+
runs-on: ubuntu-24.04
20+
outputs:
21+
run: ${{ steps.filter.outputs.run }}
22+
steps:
23+
- uses: envoyproxy/toolshed/gh-actions/github/should-run@3067ae34d13c569fe1651da3346dcba517701000
24+
id: filter
25+
with:
26+
config: |
27+
paths:
28+
- 'js/**'
29+
- '.github/workflows/js.yml'
30+
31+
js:
32+
runs-on: ubuntu-24.04
33+
needs: request
34+
if: fromJSON(needs.request.outputs.run)
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
node-version:
39+
- 20.x
40+
name:
41+
- appauth
42+
- dispatch
43+
- github/checks
44+
- github/mutex
45+
- github/script/run
46+
- hashfiles
47+
- jq
48+
- retest
49+
- torun
50+
steps:
51+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
52+
- name: Use Node.js ${{ matrix.node-version }}
53+
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
54+
with:
55+
node-version: ${{ matrix.node-version }}
56+
- run: npm ci
57+
working-directory: js/${{ matrix.name }}
58+
- run: npm run lint
59+
working-directory: js/${{ matrix.name }}
60+
- run: npm test
61+
working-directory: js/${{ matrix.name }}
62+
- run: |
63+
npm run build
64+
if [[ $(git status --porcelain) ]]; then
65+
echo 'Built javascript does not match, did you run `npm run build`?' >&2
66+
git status
67+
git diff
68+
exit 1
69+
fi
70+
working-directory: js/${{ matrix.name }}
71+
72+
status:
73+
runs-on: ubuntu-24.04
74+
if: >-
75+
always()
76+
&& github.event_name == 'pull_request'
77+
name: JavaScript
78+
needs:
79+
- request
80+
- js
81+
steps:
82+
- run: |
83+
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" || "${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
84+
echo "One or more jobs failed or were cancelled"
85+
exit 1
86+
fi
87+
echo "All required jobs passed or were skipped"

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ $RECYCLE.BIN/
174174
# Windows shortcuts
175175
*.lnk
176176

177-
!gh-actions/**/dist
177+
!js/**/dist
178178
!gh-actions/github/mutex/lib
179179

180180
# Bazel

README.md

Lines changed: 1 addition & 0 deletions

gh-actions/appauth/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ inputs:
2626
2727
runs:
2828
using: node20
29-
main: 'dist/index.js'
29+
main: '../../js/appauth/dist/index.js'

gh-actions/dispatch/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ inputs:
2222
are not one of string, number, boolean already.
2323
runs:
2424
using: node20
25-
main: 'dist/index.js'
25+
main: '../../js/dispatch/dist/index.js'

gh-actions/github/checks/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ inputs:
3232

3333
runs:
3434
using: node20
35-
main: 'dist/index.js'
35+
main: '../../../js/github/checks/dist/index.js'

gh-actions/github/mutex/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ inputs:
2020

2121
runs:
2222
using: node20
23-
main: "dist/main/index.js"
24-
post: "dist/cleanup/index.js"
23+
main: "../../../js/github/mutex/dist/main/index.js"
24+
post: "../../../js/github/mutex/dist/cleanup/index.js"
2525
post-if: "always()"
2626

2727
branding:

gh-actions/github/script/run/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ inputs:
1515

1616
runs:
1717
using: node20
18-
main: 'dist/index.js'
18+
main: '../../../js/github/script/run/dist/index.js'
1919
post: 'dist/index.js'

gh-actions/hashfiles/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ inputs:
2828
default:
2929
runs:
3030
using: node20
31-
main: 'dist/index.js'
31+
main: '../../js/hashfiles/dist/index.js'

0 commit comments

Comments
 (0)