Skip to content

Commit

Permalink
more workflow updates
Browse files Browse the repository at this point in the history
  • Loading branch information
narthur committed Aug 5, 2024
1 parent 4117312 commit 0e05042
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 127 deletions.
87 changes: 33 additions & 54 deletions .github/workflows/bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,29 @@ on:
- master
pull_request:
env:
NODE_VERSION: 16.15.0
PNPM_VERSION: 9
jobs:
base:
runs-on: ubuntu-latest
outputs:
size: ${{ steps.size.outputs.size }}
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: ${{ github.base_ref }}
- uses: pnpm/action-setup@v2.2.2
- uses: pnpm/action-setup@v4
with:
version: 7
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v2
version: ${{ env.PNPM_VERSION }}
- uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm build
- name: Save bundle size
id: size
cache: "pnpm"
- run: pnpm install
- run: pnpm build
- id: size
run: |
echo "::set-output name=size::$(du -s dist/ | awk '{print $1}')"
- name: Publish result
if: ${{ hashFiles('stats.html') != '' }}
- if: ${{ hashFiles('stats.html') != '' }}
run: pnpm dlx surge . https://${{ github.base_ref }}-stats.surge.sh --token ${{ secrets.SURGE_TOKEN }}

head:
Expand All @@ -42,41 +36,33 @@ jobs:
size: ${{ steps.size.outputs.size }}
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2.2.2
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 7
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v2
version: ${{ env.PNPM_VERSION }}
- uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm build
- name: Save bundle size
id: size
cache: "pnpm"
- run: pnpm install
- run: pnpm build
- id: size
run: |
echo "::set-output name=size::$(du -s dist/ | awk '{print $1}')"
- name: Publish result
if: ${{ hashFiles('stats.html') != '' }}
- if: ${{ hashFiles('stats.html') != '' }}
run: pnpm dlx surge . https://${{ github.head_ref }}-stats.surge.sh --token ${{ secrets.SURGE_TOKEN }}

compare:
runs-on: ubuntu-latest
needs: [base, head]
if: github.event_name == 'pull_request'
steps:
- name: Find comment
id: fc
- id: fc
uses: peter-evans/find-comment@v2
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: 'Bundle size comparison'
- name: Create or update comment
uses: peter-evans/create-or-update-comment@v2
comment-author: "github-actions[bot]"
body-includes: "Bundle size comparison"
- uses: peter-evans/create-or-update-comment@v2
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.number }}
Expand All @@ -85,8 +71,7 @@ jobs:
### Bundle size comparison
- Base: [${{needs.base.outputs.size}}](https://${{ github.base_ref }}-stats.surge.sh/stats.html)
- Head: [${{needs.head.outputs.size}}](https://${{ github.head_ref }}-stats.surge.sh/stats.html)
- name: Compare bundle sizes
run: |
- run: |
if [ "${{needs.base.outputs.size}}" -lt "${{needs.head.outputs.size}}" ]; then
exit 1
else
Expand All @@ -96,25 +81,19 @@ jobs:
bundlewatch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2.2.2
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 7
- name: Use Node.js 16.15.0
uses: actions/setup-node@v2
version: ${{ env.PNPM_VERSION }}
- uses: actions/setup-node@v2
with:
node-version: 16.15.0
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Build
run: pnpm run build
- name: Check bundle size
env:
cache: "pnpm"
- run: pnpm install
- run: pnpm run build
- env:
BUNDLEWATCH_GITHUB_TOKEN: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CI_REPO_OWNER: ${{ github.repository_owner }}
CI_REPO_NAME: taskratchet-web
CI_COMMIT_SHA: ${{ github.sha }}
CI_REPO_CI_COMMIT_SHA: ${{ github.sha }}
CI_BRANCH: ${{ github.ref_name }}
run: pnpm dlx bundlewatch
23 changes: 11 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
version: ${{ env.PNPM_VERSION }}
- uses: actions/setup-node@v4
with:
cache: 'pnpm'
cache: "pnpm"
- run: pnpm install
- run: pnpm run test
audit:
Expand All @@ -24,7 +24,7 @@ jobs:
version: ${{ env.PNPM_VERSION }}
- uses: actions/setup-node@v4
with:
cache: 'pnpm'
cache: "pnpm"
- run: pnpm install
- run: pnpm audit
outdated:
Expand All @@ -36,7 +36,7 @@ jobs:
version: ${{ env.PNPM_VERSION }}
- uses: actions/setup-node@v4
with:
cache: 'pnpm'
cache: "pnpm"
- run: pnpm install
- id: outdated
run: |
Expand All @@ -48,8 +48,8 @@ jobs:
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: 'Outdated dependencies'
comment-author: "github-actions[bot]"
body-includes: "Outdated dependencies"
- uses: peter-evans/create-or-update-comment@v2
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
Expand All @@ -63,10 +63,9 @@ jobs:
- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- name: Use Node.js 16.15.0
uses: actions/setup-node@v4
- uses: actions/setup-node@v4
with:
cache: 'pnpm'
cache: "pnpm"
- run: pnpm install
- run: pnpm dlx depcheck
lint:
Expand All @@ -76,9 +75,9 @@ jobs:
- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
cache: 'pnpm'
cache: "pnpm"
- run: pnpm install
- run: pnpm run lint
prettier:
Expand All @@ -88,7 +87,7 @@ jobs:
- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
cache: 'pnpm'
cache: "pnpm"
- run: pnpm dlx prettier --check .
36 changes: 0 additions & 36 deletions .github/workflows/deploy.yml

This file was deleted.

9 changes: 2 additions & 7 deletions .github/workflows/gitguardian.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
name: GitGuardian scan

on: [push, pull_request]

jobs:
scanning:
name: GitGuardian scan
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch all history so multiple commits can be scanned
- name: GitGuardian scan
uses: GitGuardian/ggshield-action@master
- uses: GitGuardian/ggshield-action@master
env:
GITHUB_PUSH_BEFORE_SHA: ${{ github.event.before }}
GITHUB_PUSH_BASE_SHA: ${{ github.event.base }}
Expand Down
15 changes: 0 additions & 15 deletions .github/workflows/merge.yml

This file was deleted.

5 changes: 2 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,15 @@ on:

jobs:
size:
name: Check PR size
runs-on: ubuntu-latest
steps:
- uses: ookami-kb/gh-pr-size-watcher@v1
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
errorSize: 500
errorMessage: ':no_entry: PR has more than **{allowed} additions**. Split it into smaller PRs.'
errorMessage: ":no_entry: PR has more than **{allowed} additions**. Split it into smaller PRs."
warningSize: 300
warningMessage: ':warning: PR has more than **{allowed} additions**. Consider splitting it into smaller PRs.'
warningMessage: ":warning: PR has more than **{allowed} additions**. Consider splitting it into smaller PRs."
excludePaths: |
pnpm-lock.yaml
**/*.spec.ts
Expand Down
Empty file added render.yaml
Empty file.

0 comments on commit 0e05042

Please sign in to comment.