Skip to content

Commit a958f5b

Browse files
committed
coverage testing
1 parent 0110182 commit a958f5b

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

.github/workflows/test.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
permissions:
2-
contents: read
2+
contents: write
33
on:
44
push:
55
branches: [main]
@@ -69,15 +69,18 @@ jobs:
6969
- name: cargo llvm-cov
7070
run: |
7171
mkdir -p coverage/coverage
72-
cargo llvm-cov --locked --all-features --html
73-
mv "target/llvm-cov/html" "coverage/coverage/${{ github.ref_name }}-${{ github.sha }}.html"
72+
cargo llvm-cov --locked --all-features --doctests --html
73+
mv "target/llvm-cov/html" "coverage/coverage/${{ github.sha }}"
7474
- name: Upload to gh-pages
7575
run: |
7676
cd coverage
77+
git config --global init.defaultBranch gh-pages
7778
git init
79+
git remote add origin "https://github.com/$GITHUB_REPOSITORY"
80+
git fetch origin
81+
git pull origin gh-pages
7882
git config user.name CI
7983
git config user.email ""
80-
git diff
81-
#git add .
82-
#git commit -m "Deploy $GITHUB_SHA to branch `gh-pages`"
83-
#git push --force "https://x-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY" HEAD:gh-pages
84+
git add .
85+
git commit -m "create coverage of `${{ github.head_ref }}` (${{ github.sha }})"
86+
git push "https://x-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY" HEAD:gh-pages

0 commit comments

Comments
 (0)