Skip to content

Commit

Permalink
Pull workflow setup into shared composite action
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebailey committed Mar 3, 2024
1 parent 55d1f64 commit a3a6fba
Show file tree
Hide file tree
Showing 3 changed files with 143 additions and 152 deletions.
11 changes: 11 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Setup

runs:
using: composite
steps:
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20
cache: 'npm'

- run: npm ci
30 changes: 5 additions & 25 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,8 @@ jobs:

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20
cache: 'npm'
- uses: ./.github/actions/setup

- run: npm ci
- run: npm run build
- run: git diff --exit-code --name-only dist

Expand All @@ -30,12 +26,8 @@ jobs:

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20
cache: 'npm'
- uses: ./.github/actions/setup

- run: npm ci
- run: npx tsc

test:
Expand All @@ -48,12 +40,8 @@ jobs:

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20
cache: 'npm'
- uses: ./.github/actions/setup

- run: npm ci
- run: npm run test:coverage
- uses: codecov/codecov-action@54bcd8715eee62d40e33596ef5e8f0f48dbbccab # v4.1.0
with:
Expand All @@ -66,12 +54,8 @@ jobs:

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20
cache: 'npm'
- uses: ./.github/actions/setup

- run: npm ci
- run: npx eslint .

dprint:
Expand All @@ -80,12 +64,8 @@ jobs:

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20
cache: 'npm'
- uses: ./.github/actions/setup

- run: npm ci
- run: npx dprint check

smoke-test:
Expand Down
Loading

0 comments on commit a3a6fba

Please sign in to comment.