Skip to content

Commit

Permalink
chore: create setup action (#888)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joozty authored Nov 7, 2024
1 parent adc7496 commit 9526093
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 36 deletions.
17 changes: 17 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: 'Setup'
description: 'Setup node, install deps, compile'
runs:
using: 'composite'
steps:
- uses: actions/[email protected]
with:
node-version: '18'
cache: 'npm'

- name: Install dependencies
shell: bash
run: npm ci

- name: Build project
shell: bash
run: npm run compile
4 changes: 2 additions & 2 deletions .github/workflows/check-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
linkChecker:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected].1
- uses: actions/[email protected].2

- name: Link Checker
uses: lycheeverse/lychee-action@v1.8.0
uses: lycheeverse/lychee-action@v2.1.0
with:
fail: true
21 changes: 6 additions & 15 deletions .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,12 @@ jobs:
permissions: read-all
steps:
- name: Checkout
uses: actions/[email protected]
- uses: actions/[email protected]
with:
node-version: '18'
cache: 'npm'
- run: npm ci
uses: actions/[email protected]
- name: Setup
uses: ./.github/actions/setup
- run: npm run version:check
- name: Lint code
run: npm run lint
- name: Lint docs
run: npm run lint:markdown
- name: Transpile code
run: npm run compile
- name: Unit test
Expand All @@ -36,12 +31,8 @@ jobs:
browser: [headlessChrome, headlessFirefox]
steps:
- name: Checkout
uses: actions/[email protected]
- uses: actions/[email protected]
with:
node-version: '18'
cache: 'npm'
- run: npm ci
- run: npm run compile
uses: actions/[email protected]
- name: Setup
uses: ./.github/actions/setup
- name: Local integration tests using ${{ matrix.browser }}
run: npm run test:integration:local:${{ matrix.browser }}:_execute
32 changes: 13 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@ jobs:
steps:
- name: Checkout
uses: actions/[email protected]
- uses: actions/[email protected]
with:
node-version: '18'
cache: 'npm'
- run: npm ci
- name: Setup
uses: ./.github/actions/setup
- run: npm run version:check
- name: Lint code
run: npm run lint
Expand Down Expand Up @@ -47,13 +44,11 @@ jobs:
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
tunnelName: ${{ secrets.SAUCE_TUNNEL_ID }}
- name: Checkout
uses: actions/[email protected]
- uses: actions/[email protected]
with:
node-version: '18'
cache: 'npm'
- run: npm ci
- run: npm run compile
uses: actions/[email protected]

- name: Setup
uses: ./.github/actions/setup

- name: Add to hosts file
run: echo "127.0.0.1 local.test" | sudo tee -a /etc/hosts
- name: Run integration tests in Saucelabs
Expand All @@ -69,15 +64,14 @@ jobs:
browser: [headlessChrome, headlessFirefox]
steps:
- name: Checkout
uses: actions/[email protected]
- uses: actions/[email protected]
with:
node-version: '18'
cache: 'npm'
- run: npm ci
- run: npm run compile
uses: actions/[email protected]

- name: Setup
uses: ./.github/actions/setup

- name: Local integration tests using ${{ matrix.browser }}
run: npm run test:integration:local:${{ matrix.browser }}:_execute

- name: Upload test logs
uses: actions/[email protected]
if: ${{ failure() }}
Expand Down

0 comments on commit 9526093

Please sign in to comment.