Skip to content

Commit 2e54d08

Browse files
Merge pull request #17 from monikakonieczna/Task-12-Explore-GitHub-pages
Task 12: Explore GitHub Pages
2 parents 27ba7d1 + 2120608 commit 2e54d08

File tree

5 files changed

+41
-48
lines changed

5 files changed

+41
-48
lines changed

.github/workflows/publish-report.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Publish Jest Report
2+
3+
on:
4+
# Runs on pushes targeting the default branch
5+
push:
6+
branches: ["main"]
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
12+
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout Repository
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: '20.x'
24+
25+
- name: Install dependencies
26+
run: npm install
27+
28+
- name: Run Sanity Tests And Generate Report
29+
run: npm run test:sanity
30+
31+
- name: Deploy to GitHub Pages
32+
if: success()
33+
uses: peaceiris/actions-gh-pages@v3
34+
with:
35+
github_token: ${{ secrets.GITHUB_TOKEN }}
36+
publish_dir: ./test-results
37+
publish_branch: gh-pages

.github/workflows/static-github-page.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ yarn-error.log*
77
lerna-debug.log*
88
.pnpm-debug.log*
99

10-
# Diagnostic reports (https://nodejs.org/api/report.html)
11-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
12-
test-report.html
10+
# Test reports
11+
test-results/
1312

1413
# Runtime data
1514
pids

jest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const config: Config.InitialOptions = {
99
"default",
1010
[
1111
"jest-html-reporter",
12-
{ outputDirectory: "./test-results", outputName: "test-results.html" },
12+
{ outputPath: "test-results/test-results.html"},
1313
],
1414
],
1515
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"test:all_characters": "jest --group=all_characters",
1414
"test:multiple_characters": "jest --group=multiple_characters",
1515
"test:filter_characters": "jest --group=filter_characters",
16-
"test:sanity": "jest --ci --reporters=default --reporters=jest-html-reporter --group=sanity_tests"
16+
"test:sanity": "jest --group=sanity_tests"
1717
},
1818
"devDependencies": {
1919
"@types/jest": "^29.5.12",

0 commit comments

Comments
 (0)