good morning!!!!

Skip to content
Snippets Groups Projects
Commit 0f14077d authored by Mathias Fredriksson's avatar Mathias Fredriksson
Browse files

Split coverage and deploy jobs in static.yml to avoid env issue

parent f2b9c3f4
Branches
Tags
No related merge requests found
...@@ -16,27 +16,39 @@ concurrency: ...@@ -16,27 +16,39 @@ concurrency:
cancel-in-progress: true cancel-in-progress: true
jobs: jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
- run: |
./ci/test.sh
echo "PERCENT=$(go tool cover -func ./ci/out/coverage.prof | tail -n1 | awk '{print $3}' | tr -d '%')" >> "$GITHUB_OUTPUT"
{
echo "HTML<<EOF"
cat ./ci/out/coverage.html
echo EOF
} >> "$GITHUB_OUTPUT"
deploy: deploy:
environment: environment:
name: github-pages name: github-pages
url: ${{ steps.deployment.outputs.page_url }} url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: coverage
steps: steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages - name: Setup Pages
uses: actions/configure-pages@v5 uses: actions/configure-pages@v5
- name: Setup Go - name: Write coverage.html and coverage.svg
uses: actions/setup-go@v5 env:
with: PERCENT: ${{ steps.coverage.outputs.PERCENT }}
go-version-file: ./go.mod HTML: ${{ steps.coverage.outputs.HTML }}
- name: Generate coverage and badge
run: | run: |
./ci/test.sh
mkdir -p ./ci/out/static mkdir -p ./ci/out/static
cp ./ci/out/coverage.html ./ci/out/static/coverage.html wget -O ./ci/out/static/coverage.svg "https://img.shields.io/badge/coverage-${PERCENT}%25-success"
percent=$(go tool cover -func ./ci/out/coverage.prof | tail -n1 | awk '{print $3}' | tr -d '%') echo "$HTML" > ./ci/out/static/coverage.html
wget -O ./ci/out/static/coverage.svg "https://img.shields.io/badge/coverage-${percent}%25-success"
- name: Upload artifact - name: Upload artifact
uses: actions/upload-pages-artifact@v3 uses: actions/upload-pages-artifact@v3
with: with:
......
  • a @elee

    mentioned in commit 473cd1a2

    ·

    mentioned in commit 473cd1a2

    Toggle commit list
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment