Skip to content

Commit

Permalink
Test out GH actions config adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
anselmbradford committed Oct 25, 2024
1 parent 9509201 commit bedd23c
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 70 deletions.
19 changes: 2 additions & 17 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,8 @@ jobs:
# matrix:
# containers: [1, 2] # Uses 2 parallel instances
steps:
- name: Checkout
uses: actions/checkout@v4

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

- name: Set up Ruby for Jekyll
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.3

- name: Install dependencies with Yarn
run: |
yarn install
yarn after-install
- name: Shared setup
uses: ./.github/workflows/shared-action-setup

- name: Cypress run
# Uses the official Cypress GitHub action https://github.com/cypress-io/github-action
Expand Down
35 changes: 2 additions & 33 deletions .github/workflows/lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,8 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

# Install Node and configure its cache.
- uses: actions/setup-node@v4
with:
node-version: 20

# https://github.com/actions/cache/blob/master/examples.md#node---yarn
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=.yarn/cache" >> "$GITHUB_OUTPUT"

- uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
# Install Ruby and configure the Bundler cache.
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.3

# https://github.com/actions/cache/blob/master/examples.md#ruby---bundler
- name: Set up Bundler cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Shared setup
uses: ./.github/workflows/shared-action-setup

# Build the documentation site.
# This is needed so we can determine the list of URLs to test.
Expand Down
17 changes: 7 additions & 10 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.3
- uses: actions/checkout@v4
- run: ./scripts/update-gh-pages.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Shared setup
uses: ./.github/workflows/shared-action-setup

- name: Update GitHub pages
run: ./scripts/update-gh-pages.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20 changes: 20 additions & 0 deletions .github/workflows/shared-action-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Shared action - setup"
runs:
using: "composite"
steps:
- name: Check out the repo
uses: actions/checkout@v4

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

- name: Set up Ruby for Jekyll
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2.3

- name: Install dependencies with Yarn
run: |
yarn install
12 changes: 2 additions & 10 deletions .github/workflows/tests-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,8 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Check out the repo
uses: actions/checkout@v4

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

- name: Install dependencies with Yarn
run: yarn install
- name: Shared setup
uses: ./.github/workflows/shared-action-setup

- name: Run unit tests
run: yarn jest

0 comments on commit bedd23c

Please sign in to comment.