Skip to content

Commit

Permalink
ci: set job-level permissions, tidy style (#365)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs authored Nov 20, 2024
1 parent 67b946a commit 7e9cd40
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,31 @@ concurrency:

jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Check out repo
uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20

- name: run benchmarks
run: |
npm install
npm start y 100 10 40
- name: Install dependencies
run: npm i

- name: Run benchmarks
run: npm start y 100 10 40

- name: compare results
- name: Compare results
run: |
node ./benchmark compare -t
node ./benchmark compare -u
- name: commit and push updated results
- name: Commit and push updated results
uses: github-actions-x/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@ jobs:
uses: actions/dependency-review-action@v4

test:
name: Test
runs-on: ubuntu-latest

permissions:
contents: read

strategy:
matrix:
node-version: [20, 22]

steps:
- name: Check out repo
uses: actions/checkout@v4
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,27 @@ concurrency:

jobs:
build:
name: Build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20

- name: install dependencies
run: |
npm install
- name: Install dependencies
run: npm i

- name: run metrics
- name: Run metrics
run: |
npm run metrics:run
npm run metrics:summary
- name: commit and push updated results
- name: Commit and push updated results
uses: github-actions-x/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit 7e9cd40

Please sign in to comment.