Skip to content

Commit

Permalink
ci: different approach
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Nov 21, 2023
1 parent 1883a75 commit 92d6835
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 43 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/external-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
on:
workflow_call:
inputs:
os:
required: false
description: "runs-on property, ex: ubuntu-latest, windows-latest"
type: string
default: "ubuntu-latest"
repo:
required: true
description: "Repository name, ex: 'owner/repo'"
type: string
command:
required: true
description: "Command to run, ex: 'yarn test'"
type: string
other-setup:
required: false
description: "Setup command, ex: 'yarn install'"
type: string

jobs:
external-test:
runs-on: ${{ inputs.os }}
steps:
- uses: actions/setup-node@v4
- uses: actions/checkout@v4
- uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
- run: yarn build
- run: yarn link
- run: ${{ inputs.other-setup }}
- uses: actions/checkout@v4
with:
repository: ${{ inputs.repo }}
ref: main
path: test
- name: Build plugin
working-directory: test
run: |
yarn install --network-timeout 600000 --ignore-scripts
yarn link @oclif/core
yarn build
- name: Run tests in plugin
working-directory: test
run: ${{ inputs.command }}
99 changes: 56 additions & 43 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
TESTKIT_JWT_CLIENT_ID: ${{ secrets.TESTKIT_JWT_CLIENT_ID }}
TESTKIT_JWT_KEY: ${{ secrets.TESTKIT_JWT_KEY }}
TESTKIT_HUB_INSTANCE: ${{ secrets.TESTKIT_HUB_INSTANCE }}
oclif-external-unit-tests:
external-unit-tests:
# needs: linux-unit-tests
strategy:
fail-fast: false
Expand All @@ -138,54 +138,67 @@ jobs:
- oclif/plugin-which
- oclif/plugin-warn-if-update-available
- oclif/plugin-version
runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-node@v4
- uses: actions/checkout@v4
- uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
- run: yarn build
- run: yarn link
- uses: actions/checkout@v4
with:
repository: ${{ matrix.repo }}
ref: main
path: test
- name: Build plugin
working-directory: test
run: |
yarn install --network-timeout 600000 --ignore-scripts
yarn link @oclif/core
yarn build
- name: Run tests in plugin
working-directory: test
run: yarn mocha test/**/*.test.ts --timeout 1200000
# runs-on: ${{ matrix.os }}
uses: ./.github/workflows/external-test.yml
with:
repo: ${{ matrix.repo }}
os: ${{ matrix.os }}
command: "yarn mocha test/**/*.test.ts --timeout 1200000"
# steps:
# - uses: actions/setup-node@v4
# - uses: actions/checkout@v4
# - uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
# - run: yarn build
# - run: yarn link
# - uses: actions/checkout@v4
# with:
# repository: ${{ matrix.repo }}
# ref: main
# path: test
# - name: Build plugin
# working-directory: test
# run: |
# yarn install --network-timeout 600000 --ignore-scripts
# yarn link @oclif/core
# yarn build
# - name: Run tests in plugin
# working-directory: test
# run: yarn mocha test/**/*.test.ts --timeout 1200000
plugin-plugins-integration:
# needs: linux-unit-tests
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-node@v4
- uses: actions/checkout@v4
- uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
- run: yarn build
- run: yarn link
- uses: actions/checkout@v4
with:
repository: oclif/plugin-plugins
ref: main
path: test
- name: Build plugin
working-directory: test
run: |
yarn install --network-timeout 600000 --ignore-scripts
yarn link @oclif/core
yarn build
- name: Run tests in plugin
working-directory: test
run: yarn test:integration
uses: ./.github/workflows/external-test.yml
with:
repo: oclif/plugin-plugins
os: ${{ matrix.os }}
command: "yarn test:integration"
other-setup: npm install -g @salesforce/cli@nightly
# runs-on: ${{ matrix.os }}
# steps:
# - uses: actions/setup-node@v4
# - uses: actions/checkout@v4
# - uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
# - run: yarn build
# - run: yarn link
# # plugin-plugins integration tests expect sf to be installed globally
# - run: npm isntall -g @salesforce/cli@nightly
# - uses: actions/checkout@v4
# with:
# repository: oclif/plugin-plugins
# ref: main
# path: test
# - name: Build plugin
# working-directory: test
# run: |
# yarn install --network-timeout 600000 --ignore-scripts
# yarn link @oclif/core
# yarn build
# - name: Run tests in plugin
# working-directory: test
# run: yarn test:integration
plugin-update-integration:
# needs: linux-unit-tests
strategy:
Expand Down

0 comments on commit 92d6835

Please sign in to comment.