Skip to content

Commit

Permalink
chore: add nuts tests for plugin-templates, enable automerge for depe…
Browse files Browse the repository at this point in the history
…ndabot (#597)

* chore: add nuts tests for plugin-templates, enable automerge for dependabot

* chore: comment pre commands

* chore: remove ignore scripts

* chore: remove nuts tests on windows

* chore: custom nuts tests

* chore: update repo

* chore: typo

* chore: try yarn husky install

* chore: add yarn add husky --dev

* chore: add yarn add husky --dev

* chore: try ignore scripts

* chore: install CLI

* chore: do not ignore script

* chore: try yarn build

* chore: try modifying build-templates scripts

* chore: typo

* chore: revert change in script

* chore: keep ols config of dependabot as well

* chore: update validate PR workflow to be triggered on any new change to the PR
  • Loading branch information
CristiCanizales authored Aug 26, 2024
1 parent ce94c6a commit 121a331
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 1 deletion.
23 changes: 23 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,30 @@
version: 2
updates:
# For sf project templates
- package-ecosystem: npm
directory: '/src/templates/project'
schedule:
interval: daily
open-pull-requests-limit: 10

# For all @salesforce/templates library
- package-ecosystem: npm
directory: '/'
schedule:
interval: 'weekly'
day: 'saturday'
versioning-strategy: 'increase'
labels:
- 'dependencies'
open-pull-requests-limit: 5
pull-request-branch-name:
separator: '-'
commit-message:
# cause a release for non-dev-deps
prefix: fix(deps)
# no release for dev-deps
prefix-development: chore(dev-deps)
ignore:
- dependency-name: '@salesforce/dev-scripts'
- dependency-name: '*'
update-types: ['version-update:semver-major']
10 changes: 10 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: automerge
on:
workflow_dispatch:
schedule:
- cron: '42 2,5,8,11 * * *'

jobs:
automerge:
uses: salesforcecli/github-workflows/.github/workflows/automerge.yml@main
secrets: inherit
40 changes: 40 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,43 @@ jobs:
uses: ./.github/workflows/unitTestsLinux.yml
windows-unit-tests:
uses: ./.github/workflows/unitTestsWindows.yml
external-test:
name: run tests in plugin-templates
runs-on: 'ubuntu-latest'
steps:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- name: Install CLI
uses: salesforcecli/github-workflows/.github/actions/retry@main
with:
max_attempts: 3
command: npm install -g @salesforce/cli@nightly shx yarn-deduplicate --omit=dev
timeout_minutes: 20
- name: Checkout to external project
uses: actions/checkout@v4
with:
repository: 'salesforcecli/plugin-templates'
- name: Swap dependency
run: |
yarn install --network-timeout 600000
yarn remove @salesforce/templates
yarn add forcedotcom/salesforcedx-templates#${{ github.sha }}
npx yarn-deduplicate
yarn install --network-timeout 600000
- name: install/build @salesforce/templates in node_modules
working-directory: node_modules/@salesforce/templates
run: |
yarn add husky --dev
yarn husky install
yarn install --network-timeout 600000
yarn build
- name: Build the external project (where the tests are)
run: yarn build
- name: Run tests
uses: salesforcecli/github-workflows/.github/actions/retry@main
with:
max_attempts: 3
command: yarn test:nuts
retry_on: error
2 changes: 1 addition & 1 deletion .github/workflows/validatePR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: PR Validation

on:
pull_request:
types: [opened, reopened, edited]
types: [opened, reopened, edited, synchronize]
# only applies to PRs that want to merge to main
branches: [main]

Expand Down

0 comments on commit 121a331

Please sign in to comment.