add test for 177ce7bfc9ac792d5f86faf4730e02cc7b4fb0ed #38
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master" ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [18.x] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- run: NODE_V8_COVERAGE=./coverage node --test --experimental-test-coverage | |
- run: npx -y c8 report --temp-directory ./coverage --reporter html | |
- run: | | |
chmod -c -R +rX "coverage/" | while read line; do | |
echo "::warning title=Invalid file permissions automatically fixed::$line" | |
done | |
- run: 'rm ./coverage/*.json' | |
- name: upload cov report | |
uses: actions/upload-artifact@v3 | |
with: | |
name: cov_data | |
path: coverage/* | |
cov: | |
runs-on: ubuntu-latest | |
needs: test | |
if: github.ref == 'refs/heads/master' | |
permissions: | |
pages: write | |
id-token: write | |
contents: read | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
environment: | |
name: github-pages | |
url: ${{ steps.cov.outputs.page_url }} | |
steps: | |
- name: dl cov report | |
uses: actions/download-artifact@v3 | |
with: | |
name: cov_data | |
- name: Setup Pages | |
uses: actions/configure-pages@v3 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: './' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |