From d124574d440204fce724519570a6f3643b680f90 Mon Sep 17 00:00:00 2001 From: Wes Cossick Date: Thu, 7 Dec 2023 16:11:22 -0600 Subject: [PATCH] Modernize GitHub actions configuration --- .github/workflows/main.yml | 82 +++++++++----------------------------- 1 file changed, 19 insertions(+), 63 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6564f1a..5be57ce 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,22 +18,13 @@ 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- - - run: yarn dev + cache: 'yarn' + - run: yarn install --frozen-lockfile --prefer-offline - run: yarn lint test: name: Run tests @@ -42,22 +33,13 @@ jobs: matrix: 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- - - run: yarn dev + cache: 'yarn' + - run: yarn install --frozen-lockfile --prefer-offline - run: yarn test - name: Codecov uses: codecov/codecov-action@v3 @@ -65,21 +47,12 @@ 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- + cache: 'yarn' - run: yarn dev - run: yarn --cwd ./website type-check - run: yarn --cwd ./website build @@ -92,23 +65,15 @@ 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 dev + - run: yarn install --frozen-lockfile --prefer-offline + - run: yarn compile - run: yarn publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} @@ -121,22 +86,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 dev - run: yarn --cwd ./website build - name: Deploy to GitHub Pages