Skip to content

Commit 8764153

Browse files
committed
Switch jobs back to steps
1 parent cb2e43c commit 8764153

File tree

1 file changed

+33
-73
lines changed

1 file changed

+33
-73
lines changed

.github/workflows/node.js.yml

Lines changed: 33 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ concurrency:
2222
cancel-in-progress: false
2323

2424
jobs:
25-
checkout:
25+
deploy:
2626
runs-on: ubuntu-latest
2727
steps:
2828
- name: Checkout
@@ -44,12 +44,9 @@ jobs:
4444
file: package.json
4545
field: homepage
4646
value: ${{ steps.get-repo-values.outputs.url }}
47-
48-
create_redirects:
49-
runs-on: ubuntu-latest
50-
needs: checkout
51-
steps:
47+
# create_redirects
5248
- name: Create Redirects and Links
49+
id: create_redirects
5350
run: |
5451
mkdir -p dist
5552
echo "<html><head>\
@@ -63,59 +60,40 @@ jobs:
6360
echo "<html><head>\
6461
<meta http-equiv='refresh' content='0; URL=docs/quick-links' />\
6562
</head><body>Redirecting to quick links page</body></html>" > ./dist/quick.html
66-
67-
install:
68-
runs-on: ubuntu-latest
69-
needs: create_redirects
70-
steps:
7163
# Install node packages
7264
- name: Install
65+
id: install
7366
run: |
7467
echo "<html><body><pre>" > ./dist/installation.html
7568
npm install |& tee -a ./dist/installation.html
7669
echo "</pre></body></html>" >> ./dist/installation.html
7770
echo "* [Installation](../installation.html)" >> docs/quick-links.md
78-
79-
lint:
80-
runs-on: ubuntu-latest
81-
needs: install
82-
if: success()
83-
steps:
71+
# Run linter
8472
- name: Run Linter
73+
id: lint
8574
run: |
8675
npm run eslint-output
8776
echo "* [Linter](../lint.html)" >> docs/quick-links.md
88-
89-
build:
90-
runs-on: ubuntu-latest
91-
needs: lint
92-
if: success()
93-
steps:
77+
# Build the project
9478
- name: Build the project
79+
id: build
9580
run: |
9681
echo "<html><body><pre>" > ./dist/build.html
9782
npm run build |& tee -a ./dist/build.html
9883
echo "</pre></body></html>" >> ./dist/build.html
9984
echo "* [Build](../build.html)" >> docs/quick-links.md
100-
101-
test:
102-
runs-on: ubuntu-latest
103-
needs: build
104-
if: success()
105-
steps:
85+
# Run Tests
10686
- name: Run Tests
87+
id: test
10788
run: |
10889
echo "<html><body><pre>" > ./dist/tests.html
10990
npm run test -- --coverage |& tee -a ./dist/tests.html
11091
echo "</pre></body></html>" >> ./dist/tests.html
11192
echo "* [Tests](../tests.html)" >> docs/quick-links.md
112-
113-
integrity:
114-
runs-on: ubuntu-latest
115-
needs: create_redirects
116-
if: success()
117-
steps:
93+
# Verify Integrity
11894
- name: Verify Integrity
95+
if: ${{ !cancelled() }}
96+
id: integrity
11997
run: |
12098
echo "<html><body><pre>" > ./dist/integrity.html
12199
FILES="test/* .eslintrc.js .eslintrc.json .github/workflows/deploy.yml src/**/*.test.ts src/**/*.test.tsx"
@@ -126,61 +104,43 @@ jobs:
126104
done
127105
echo "</pre></body></html>" >> ./dist/integrity.html
128106
echo "* [Integrity](../integrity.html)" >> docs/quick-links.md
129-
130-
git_inspector:
131-
runs-on: ubuntu-latest
132-
needs: create_redirects
133-
steps:
107+
# Create GitInspector Report
134108
- name: Create GitInspector Report
109+
if: ${{ !cancelled() }}
110+
id: gitinspector
135111
run: |
136112
git clone https://github.com/jpwhite3/gitinspector.git
137113
python ./gitinspector/gitinspector.py ./ --grading --format=html -f tsx,ts,html,css -x ./gitinspector -x ./node_modules -x ./wbcore > ./dist/git.html
138114
echo "* [Git Inspector](../git.html)" >> docs/quick-links.md
139-
140-
generate_docs:
141-
runs-on: ubuntu-latest
142-
needs: [install, lint, build, test, integrity, git_inspector]
143-
if: success() || failure()
144-
steps:
115+
# Generate HTML from Markdown in Docs/
145116
- name: Generate HTML from Markdown in Docs/
117+
if: ${{ !cancelled() }}
118+
id: markdown-docs
146119
uses: ldeluigi/markdown-docs@latest
147120
with:
148121
src: docs
149122
dst: dist/docs/
150123

151-
deploy:
152-
runs-on: ubuntu-latest
153-
needs: generate_docs
154-
steps:
124+
#- name: Handle Failure
125+
# run: |
126+
# echo "<html><body><h1>Build Failure</h1><p>The build failed during one of the steps.</p>" > ./dist/index.html
127+
#- uses: austenstone/[email protected]
128+
# id: job-summary
129+
# with:
130+
# create-pdf: false
131+
#- run: |
132+
# echo "${{ steps.job-summary.outputs.job-summary }}" >> ./dist/index.html
133+
# echo "</body></html>" >> ./dist/index.html
134+
# Deploy
155135
- name: Setup Pages
156136
uses: actions/configure-pages@v3
137+
if: ${{ !cancelled() }}
157138
- name: Upload artifact
158139
uses: actions/upload-pages-artifact@v2
140+
if: ${{ !cancelled() }}
159141
with:
160142
path: "dist/"
161143
- name: Deploy to GitHub Pages
162144
id: deployment
163145
uses: actions/deploy-pages@v2
164-
165-
handle_failure:
166-
runs-on: ubuntu-latest
167-
needs: [create_redirects, checkout, generate_docs, deploy]
168-
if: failure()
169-
steps:
170-
- name: Handle Failure
171-
run: |
172-
echo "<html><body><h1>Build Failure</h1><p>The build failed during one of the steps.</p>" > ./dist/index.html
173-
- uses: austenstone/[email protected]
174-
id: job-summary
175-
with:
176-
create-pdf: false
177-
- run: |
178-
echo "${{ steps.job-summary.outputs.job-summary }}" >> ./dist/index.html
179-
echo "</body></html>" >> ./dist/index.html
180-
- name: Upload failure artifact
181-
uses: actions/upload-pages-artifact@v2
182-
with:
183-
path: "dist/"
184-
- name: Deploy to GitHub Pages
185-
id: deployment
186-
uses: actions/deploy-pages@v2
146+
if: ${{ !cancelled() }}

0 commit comments

Comments
 (0)