-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (59 loc) · 2.34 KB
/
externalLint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
on:
workflow_call:
inputs:
packageName:
description: 'The npm package that this repository publishes. ex: @salesforce/core'
required: true
type: string
externalProjectGitUrl:
description: 'The url that will be cloned. This contains the NUTs you want to run. Ex: https://github.com/salesforcecli/plugin-user'
type: string
required: true
command:
required: false
type: string
default: yarn eslint "src/**/*.ts" --fix
description: 'command to execute (ex: yarn lint)'
preBuildCommands:
required: false
description: 'commands to run before the build...for example, to delete known module conflicts'
type: string
default: 'echo "no preBuildCommands passed"'
postBuildCommands:
required: false
description: 'script to run after the build'
type: string
default: 'echo "no postBuildCommands passed"'
preExternalBuildCommands:
required: false
description: 'commands to run before the build of the external repo...for example, to delete known module conflicts'
type: string
default: 'echo "no preExternalBuildCommands passed"'
jobs:
external-lint:
name: ${{ inputs.command }}
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.nodeVersion }}
- run: git clone ${{ inputs.externalProjectGitUrl}} $(pwd)
- run: npm install -g yarn-deduplicate
- uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
- run: npx yarn-deduplicate
- uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
- name: swap this dependency for the version on this branch
run: |
yarn remove ${{ inputs.packageName }}
yarn add ${{ github.repository }}#${{ github.sha }} --dev
- name: install/build ${{ inputs.packageName}} in node_modules
working-directory: node_modules/${{ inputs.packageName }}
run: |
yarn install --network-timeout 600000
${{ inputs.preBuildCommands }}
yarn build
${{ inputs.postBuildCommands }}
- name: preExternalBuildCommands
run: ${{ inputs.preExternalBuildCommands }}
- name: lint
run: ${{ inputs.command }}