Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 43 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ env:
jobs:
format:
runs-on: ubuntu-latest
outputs:
sha: ${{ steps.head.outputs.sha }}
permissions:
contents: write

Expand Down Expand Up @@ -52,14 +54,19 @@ jobs:
git commit -m "style: format files"
git push

- id: head
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"

test:
needs: format
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event_name == 'push' && github.ref_name || github.sha }}
ref: ${{ needs.format.outputs.sha }}

- uses: actions/setup-node@v6
with:
Expand All @@ -77,13 +84,48 @@ jobs:

- run: npm test

- run: npm run bench

- name: Generate README results from this CI run
run: npm run reports:ci

- name: Upload test, coverage, and benchmark reports
if: always()
uses: actions/upload-artifact@v7
with:
name: bytecodec-reports
include-hidden-files: true
path: |
README.md
test/.results/
benchmark/.results/
coverage/
test-results/

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage/lcov.info
fail_ci_if_error: true

- name: Commit generated README results
if: github.event_name == 'push'
env:
TESTED_SHA: ${{ needs.format.outputs.sha }}
run: |
current_sha=$(git ls-remote origin refs/heads/master | cut -f1)
if [ "$current_sha" != "$TESTED_SHA" ]; then
echo "master advanced during this run; results remain available in the artifact"
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add README.md
if git diff --cached --quiet; then exit 0; fi
git commit -m "docs: update CI test and benchmark results"
git push origin HEAD:master

release-please:
if: github.event_name == 'push'
needs: test
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@ test-results/
.DS_Store
Thumbs.db

.wrangler/
.wrangler/
test/.results/
benchmark/.results/
playwright-report/
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ playwright-report
*.lock
CHANGELOG.md
docs

test/.results
benchmark/.results
Loading
Loading