Skip to content

Commit

Permalink
Merge pull request #124 from sparksuite/modernize-actions-config
Browse files Browse the repository at this point in the history
Modernize GitHub actions configuration
  • Loading branch information
WesCossick authored Dec 7, 2023
2 parents 0387377 + 7499731 commit 7cf266b
Showing 1 changed file with 16 additions and 63 deletions.
79 changes: 16 additions & 63 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,12 @@ jobs:
name: Lint code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
cache: 'yarn'
- run: yarn install --frozen-lockfile --prefer-offline
- run: yarn lint
test:
Expand All @@ -43,21 +34,12 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
node-version: [lts/*, current]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
cache: 'yarn'
- run: yarn install --frozen-lockfile --prefer-offline
- run: yarn test
- name: Codecov
Expand All @@ -66,24 +48,13 @@ jobs:
name: Verify website
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install --frozen-lockfile --prefer-offline
- run: yarn compile
- run: yarn --cwd ./website install --frozen-lockfile --prefer-offline
cache: 'yarn'
- run: yarn dev
- run: yarn --cwd ./website type-check
- run: yarn --cwd ./website build
publish:
Expand All @@ -95,22 +66,13 @@ jobs:
- verify-website
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: 'yarn'
registry-url: 'https://registry.npmjs.org'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install --frozen-lockfile --prefer-offline
- run: yarn compile
- run: yarn publish
Expand All @@ -125,22 +87,13 @@ jobs:
- verify-website
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: 'yarn'
registry-url: 'https://registry.npmjs.org'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install --frozen-lockfile --prefer-offline
- run: yarn compile
- run: yarn --cwd ./website install --frozen-lockfile --prefer-offline
Expand Down

0 comments on commit 7cf266b

Please sign in to comment.