Skip to content

Commit

Permalink
refactor: improve labels in GitHub action runs
Browse files Browse the repository at this point in the history
Before:

    Set up job
    Run actions/checkout@v3
    Use Node.js 18.x
    Use or update Yarn cache
    Run yarn --cache-folder=.yarn --frozen-lockfile
    Run yarn --cache-folder=.yarn build
    Run yarn --cache-folder=.yarn test
    Post Use or update Yarn cache
    Post Use Node.js 18.x
    Post Run actions/checkout@v3
    Complete job

After:

    Set up job
    Run actions/checkout@v3
    Run actions/setup-node@v3 (18.x)
    Run actions/cache@v3
    yarn
    yarn build
    yarn test
    Post Run actions/cache@v3
    Post Run actions/setup-node@v3 (18.x)
    Post Run actions/checkout@v3
    Complete job
  • Loading branch information
wincent committed Aug 5, 2023
1 parent 314244c commit c77819f
Showing 1 changed file with 28 additions and 24 deletions.
52 changes: 28 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,18 @@ jobs:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
- name: Run actions/setup-node@v3 (${{ matrix.node-version}})
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Use or update Yarn cache
uses: actions/cache@v3
- uses: actions/cache@v3
with:
path: ${{ env.yarn-cache-path }}
key: ${{ matrix.node-version }}-${{ env.yarn-cache-name }}-${{ hashFiles('**/yarn.lock') }}
- run: yarn --cache-folder=${{ env.yarn-cache-path }}
- run: git diff --quiet -- yarn.lock
- name: yarn
run: yarn --cache-folder=${{ env.yarn-cache-path }}
- name: Check yarn.lock for changes
run: git diff --quiet -- yarn.lock

format-check:
runs-on: ubuntu-latest
Expand All @@ -37,12 +38,11 @@ jobs:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
- name: Run actions/setup-node@v3 (${{ matrix.node-version}})
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Use or update Yarn cache
uses: actions/cache@v3
- uses: actions/cache@v3
with:
path: ${{ env.yarn-cache-path }}
key: ${{ matrix.node-version }}-${{ env.yarn-cache-name }}-${{ hashFiles('**/yarn.lock') }}
Expand All @@ -56,17 +56,18 @@ jobs:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
- name: Run actions/setup-node@v3 (${{ matrix.node-version}})
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Use or update Yarn cache
uses: actions/cache@v3
- uses: actions/cache@v3
with:
path: ${{ env.yarn-cache-path }}
key: ${{ matrix.node-version }}-${{ env.yarn-cache-name }}-${{ hashFiles('**/yarn.lock') }}
- run: yarn --cache-folder=${{ env.yarn-cache-path }} --frozen-lockfile
- run: yarn --cache-folder=${{ env.yarn-cache-path }} lint
- name: yarn
run: yarn --cache-folder=${{ env.yarn-cache-path }} --frozen-lockfile
- name: yarn lint
run: yarn --cache-folder=${{ env.yarn-cache-path }} lint

build:
runs-on: ubuntu-latest
Expand All @@ -75,17 +76,18 @@ jobs:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
- name: Run actions/setup-node@v3 (${{ matrix.node-version}})
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Use or update Yarn cache
uses: actions/cache@v3
- uses: actions/cache@v3
with:
path: ${{ env.yarn-cache-path }}
key: ${{ matrix.node-version }}-${{ env.yarn-cache-name }}-${{ hashFiles('**/yarn.lock') }}
- run: yarn --cache-folder=${{ env.yarn-cache-path }} --frozen-lockfile
- run: yarn --cache-folder=${{ env.yarn-cache-path }} build
- name: yarn
run: yarn --cache-folder=${{ env.yarn-cache-path }} --frozen-lockfile
- name: yarn build
run: yarn --cache-folder=${{ env.yarn-cache-path }} build

test:
runs-on: ubuntu-latest
Expand All @@ -94,15 +96,17 @@ jobs:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
- name: Run actions/setup-node@v3 (${{ matrix.node-version}})
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Use or update Yarn cache
uses: actions/cache@v3
- uses: actions/cache@v3
with:
path: ${{ env.yarn-cache-path }}
key: ${{ matrix.node-version }}-${{ env.yarn-cache-name }}-${{ hashFiles('**/yarn.lock') }}
- run: yarn --cache-folder=${{ env.yarn-cache-path }} --frozen-lockfile
- run: yarn --cache-folder=${{ env.yarn-cache-path }} build # Prime cache.
- run: yarn --cache-folder=${{ env.yarn-cache-path }} test
- name: yarn
run: yarn --cache-folder=${{ env.yarn-cache-path }} --frozen-lockfile
- name: yarn build
run: yarn --cache-folder=${{ env.yarn-cache-path }} build # Prime cache.
- name: yarn test
run: yarn --cache-folder=${{ env.yarn-cache-path }} test

0 comments on commit c77819f

Please sign in to comment.