Skip to content

update doc

update doc #421

Workflow file for this run

name: Test
on:
push:
branches:
- "master"
- "develop"
pull_request:
branches:
- "master"
- "develop"
permissions:
contents: read
pages: write
id-token: write
jobs:
test:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: setup go
uses: actions/setup-go@v2
with:
go-version: '1.21.4'
id: go
- name: Check out code
uses: actions/checkout@v2
- name: Go Generate
run: go generate ./...
- name: Run tests with coverage
run: go test -coverprofile=coverage.out $(go list ./x/... | grep -v mock)
- name: Set custom env var
run: |
if [[ "${{ github.event_name }}" == "push" ]]; then
echo "BRANCH_NAME=${{ github.ref_name }}" >> $GITHUB_ENV
elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "BRANCH_NAME=pr-${{ github.event.number }}" >> $GITHUB_ENV
fi
- name: Download current site
continue-on-error: true
run: |
wget "https://totegamma.github.io/concurrent/archive.zip" -O temp.zip
unzip temp.zip
- name: Generate coverage report
run : |
mkdir -p "dist/$BRANCH_NAME"
go tool cover -html=coverage.out -o "./dist/$BRANCH_NAME/index.html"
- name: Create archive
run : |
zip -r archive.zip ./dist
mv archive.zip ./dist
- name: Create index.html
run: |
cd dist
dirs=`find * -maxdepth 0 -type d`
echo "<html><head></head><body><ul>" > index.html
for dir in $dirs; do
echo "<li><a href=\"/concurrent/$dir\">$dir</a></li>" >> index.html
done
echo "</ul></body></html>" >> index.html
- name: Setup pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: './dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2