diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml new file mode 100644 index 0000000000000000000000000000000000000000..dcde3c4b6588ed2b90e7eeb57a84e1ed6f0ba1c7 --- /dev/null +++ b/.github/workflows/static.yml @@ -0,0 +1,42 @@ +name: static + +on: + push: + branches: ['master'] + workflow_dispatch: + +# Set permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages. +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: true + +jobs: + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Generate coverage and badge + run: | + ./ci/test.sh + mkdir -p ./ci/out/static + cp ./ci/out/coverage.html ./ci/out/static/coverage.html + percent=$(go tool cover -func ./ci/out/coverage.prof | tail -n1 | awk '{print $3}' | tr -d '%') + wget -O ./ci/out/static/coverage.svg "https://img.shields.io/badge/coverage-${percent}%25-success" + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./ci/out/static/ + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/README.md b/README.md index c74b79ddcbbc89d8e9da070ba54e0af288591a28..44a6ddf09dfbdd73f2c744f0cb87d2855fc71e41 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # websocket [](https://pkg.go.dev/github.com/coder/websocket) -[](https://github.com/coder/websocket/coverage.html) +[](https://coder.github.io/websocket/coverage.html) websocket is a minimal and idiomatic WebSocket library for Go.