Skip to content

Commit

Permalink
ci: update ci workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
gbotrel committed Oct 12, 2023
1 parent 2065441 commit 27ea866
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 18 deletions.
32 changes: 21 additions & 11 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ on: pull_request
name: pull_request
jobs:
staticcheck:
runs-on: ubuntu-22.04-16core
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -38,10 +38,10 @@ jobs:

test:
runs-on: ubuntu-22.04-16core
needs:
- staticcheck
permissions:
pull-requests: write
outputs:
failures: ${{ steps.generate-job-summary.outputs.failures }}
steps:
- name: checkout code
uses: actions/checkout@v4
Expand All @@ -65,20 +65,29 @@ jobs:
- name: Run tests
run: |
set -euo pipefail
go test -json -v -short -timeout=30m ./... 2>&1 | tee /tmp/gotest.log | gotestfmt
go test -json -v -tags=purego -timeout=30m ./... 2>&1 | tee -a /tmp/gotest.log | gotestfmt
go test -json -v -race -timeout=30m ./ecc/bn254/... 2>&1 | tee -a /tmp/gotest.log | gotestfmt
GOARCH=386 go test -json -short -v -timeout=30m ./ecc/bn254/... 2>&1 | tee -a /tmp/gotest.log | gotestfmt
go test -json -v -short -timeout=30m ./... 2>&1 | gotestfmt -hide=all | tee /tmp/gotest.log
go test -json -v -tags=purego -timeout=30m ./... 2>&1 | gotestfmt -hide=all | tee -a /tmp/gotest.log
go test -json -v -race -timeout=30m ./ecc/bn254/... 2>&1 | gotestfmt -hide=all | tee -a /tmp/gotest.log
GOARCH=386 go test -json -short -v -timeout=30m ./ecc/bn254/... 2>&1 | gotestfmt -hide=all | tee -a /tmp/gotest.log
- name: Generate job summary
id: generate-job-summary
if: ${{ always() }}
run: |
cat /tmp/gotest.log | node .github/parse-tests.js > /tmp/gotest.md
cat /tmp/gotest.md > $GITHUB_STEP_SUMMARY
if [ -s /tmp/gotest.log ]; then
cat /tmp/gotest.log > $GITHUB_STEP_SUMMARY
echo "failures=$(cat /tmp/gotest.log | node .github/parse-tests.js)" > $GITHUB_OUTPUT
else
echo "## Success ✅" > $GITHUB_STEP_SUMMARY
echo "failures=" > $GITHUB_OUTPUT
fi
# if we failed a test, we want to comment on the PR with the log
- name: PR comment with file
if: ${{ failure() }}
uses: thollander/actions-comment-pull-request@v2
with:
filePath: /tmp/gotest.md
filePath: /tmp/gotest.log

slack-workflow-status-failed:
if: failure()
Expand All @@ -99,7 +108,8 @@ jobs:
"status": "FAIL",
"title": "${{ github.event.pull_request.title }}",
"pr": "${{ github.event.pull_request.head.ref }}",
"failed_step_url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/"
"failed_step_url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/",
"message": "${{ needs.test.outputs.failures }}"
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
Expand Down
24 changes: 17 additions & 7 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
name: push_master
jobs:
staticcheck:
runs-on: ubuntu-22.04-16core
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -47,6 +47,8 @@ jobs:
runs-on: ${{ matrix.os }}
needs:
- staticcheck
outputs:
failures: ${{ steps.generate-job-summary.outputs.failures }}
steps:
- name: checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -74,14 +76,22 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: |
set -euo pipefail
go test -json -v -timeout=30m ./... 2>&1 | tee /tmp/gotest.log | gotestfmt
go test -json -v -tags=purego -timeout=30m ./... 2>&1 | tee -a /tmp/gotest.log | gotestfmt
go test -json -v -race -timeout=30m ./ecc/bn254/... 2>&1 | tee -a /tmp/gotest.log | gotestfmt
GOARCH=386 go test -json -short -v -timeout=30m ./ecc/bn254/... 2>&1 | tee -a /tmp/gotest.log | gotestfmt
go test -json -v -timeout=30m ./... 2>&1 | gotestfmt -hide=all | tee /tmp/gotest.log
go test -json -v -tags=purego -timeout=30m ./... 2>&1 | gotestfmt -hide=all | tee -a /tmp/gotest.log
go test -json -v -race -timeout=30m ./ecc/bn254/... 2>&1 | gotestfmt -hide=all | tee -a /tmp/gotest.log
GOARCH=386 go test -json -short -v -timeout=30m ./ecc/bn254/... 2>&1 | gotestfmt -hide=all | tee -a /tmp/gotest.log
- name: Generate job summary
if: matrix.os == 'ubuntu-latest'
id: generate-job-summary
if: matrix.os == 'ubuntu-latest' && ${{ always() }}
run: |
cat /tmp/gotest.log | node .github/parse-tests.js > $GITHUB_STEP_SUMMARY
if [ -s /tmp/gotest.log ]; then
cat /tmp/gotest.log > $GITHUB_STEP_SUMMARY
echo "failures=$(cat /tmp/gotest.log | node .github/parse-tests.js)" > $GITHUB_OUTPUT
else
echo "## Success ✅" > $GITHUB_STEP_SUMMARY
echo "failures=" > $GITHUB_OUTPUT
fi
slack-workflow-status-failed:
if: failure()
Expand Down

0 comments on commit 27ea866

Please sign in to comment.