Skip to content

Commit

Permalink
Reusable workflow take 2
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeharder committed May 18, 2024
1 parent 747d762 commit 229b271
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 57 deletions.
33 changes: 24 additions & 9 deletions .github/workflows/eng-tools-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,38 @@ name: eng/tools Test
on:
workflow_call:
inputs:
runs-on:
description: Name of OS to run on
required: true
type: string
node-version:
description: Version of Node to install and use
required: true
type: number
package:
description: Name of package under eng/tools
required: true
type: string

jobs:
test:
runs-on: ${{ inputs.runs-on }}
strategy:
matrix:
runs-on: [ubuntu-latest, windows-latest]
node-version: [18, 20]
exclude:
- runs-on: ubuntu-latest
node-version: 20
- runs-on: windows-latest
node-version: 18

runs-on: ${{ matrix.runs-on }}

steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
.github
eng
- uses: ./.github/workflows/eng-tools-test.yaml
with:
runs-on: ${{ matrix.runs-on }}
package: suppressions
node-version: ${{ matrix.node-version }}

- name: Use Node ${{ inputs.node-version }}.x
uses: actions/setup-node@v4
with:
Expand Down
28 changes: 4 additions & 24 deletions .github/workflows/suppressions-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,14 @@ on:
- package-lock.json
- package.json
- tsconfig.json
- .github/workflows/eng-tools-test.yaml
- .github/workflows/suppressions-test.yaml
- eng/tools/package.json
- eng/tools/tsconfig.json
- eng/tools/suppressions

jobs:
test:
strategy:
matrix:
runs-on: [ubuntu-latest, windows-latest]
node-version: [18, 20]
exclude:
- runs-on: ubuntu-latest
node-version: 20
- runs-on: windows-latest
node-version: 18

runs-on: ${{ matrix.runs-on }}

steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
.github
eng
- uses: ./.github/workflows/eng-tools-test.yaml
with:
runs-on: ${{ matrix.runs-on }}
package: suppressions
node-version: ${{ matrix.node-version }}
uses: ./.github/workflows/eng-tools-test.yaml
with:
package: suppressions
28 changes: 4 additions & 24 deletions .github/workflows/typespec-validation-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ on:
- package-lock.json
- package.json
- tsconfig.json
- .github/workflows/eng-tools-test.yaml
- .github/workflows/typespec-validation-test.yaml
- eng/tools/package.json
- eng/tools/tsconfig.json
Expand All @@ -23,27 +24,6 @@ on:

jobs:
test:
strategy:
matrix:
runs-on: [ubuntu-latest, windows-latest]
node-version: [18, 20]
exclude:
- runs-on: ubuntu-latest
node-version: 20
- runs-on: windows-latest
node-version: 18

runs-on: ${{ matrix.runs-on }}

steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
.github
eng
- uses: ./.github/workflows/eng-tools-test.yaml
with:
runs-on: ${{ matrix.runs-on }}
package: typespec-validation
node-version: ${{ matrix.node-version }}
uses: ./.github/workflows/eng-tools-test.yaml
with:
package: typespec-validation

0 comments on commit 229b271

Please sign in to comment.