forked from commaai/new-connect
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4773c1c
commit bb23513
Showing
1 changed file
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: identical_to_build | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 1 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: oven-sh/setup-bun@v1 | ||
|
||
- run: bun install --frozen-lockfile | ||
- run: timeout 12s bun pre-commit | ||
- run: bun run test | ||
- run: ./check-lines.sh | ||
|
||
- name: Bundle size breakdown | ||
run: | | ||
bun run build --sourcemap true | ||
node src/ci/dependency_report.cjs dist/ | column -t -s ":" | ||
- run: ./check-bundle-size.sh | ||
|
||
- name: Build for Lighthouse | ||
run: bun run build | ||
|
||
- name: Run Lighthouse CI | ||
uses: treosh/lighthouse-ci-action@v10 | ||
id: lighthouse | ||
with: | ||
configPath: './lighthouserc.json' | ||
uploadArtifacts: true | ||
temporaryPublicStorage: true | ||
|
||
- name: Upload Lighthouse reports | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: lighthouse-reports | ||
path: ${{ steps.lighthouse.outputs.resultsPath }} | ||
|
||
- name: Check Lighthouse CI status | ||
if: steps.lighthouse.outputs.assertionResults != '[]' | ||
run: | | ||
echo "Lighthouse CI assertions failed. Check the report for details." | ||
exit 1 | ||
build: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 1 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: oven-sh/setup-bun@v1 | ||
- run: bun install --frozen-lockfile | ||
- run: bun run build | ||
|
||
- name: Upload built project | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
path: ./dist | ||
overwrite: true | ||
retention-days: 1 | ||
name: build-artifacts-${{ github.run_id }} | ||
|
||
- name: Deploy to Cloudflare Pages | ||
if: github.ref == 'refs/heads/master' && github.repository == 'commaai/new-connect' | ||
uses: cloudflare/wrangler-action@v3 | ||
with: | ||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
apiToken: ${{ secrets.CLOUDFLARE_PAGES_TOKEN }} | ||
command: pages deploy dist --project-name=connect --branch=new-connect --commit-dirty=true |