Skip to content

Commit

Permalink
ci: use amplify windows worker for smoke tests (#13188)
Browse files Browse the repository at this point in the history
* ci: use amplify windows worker for smoke tests

* ci: add this

* ci: try this

* ci: try this

* Revert "ci: try this"

This reverts commit dbb7c14.

* chore: revert

* ci: try this

* Revert "ci: try this"

This reverts commit 7019317.

* chore: try this

* chore: try this

* chore: try this

* chore: try this too

* ci: delete windows custom

* chore: try this

* Revert "chore: try this"

This reverts commit 8328fa6.

* chore: try this

* chore: comments
  • Loading branch information
sobolk authored Sep 5, 2023
1 parent fe043d5 commit b08a945
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 126 deletions.
5 changes: 4 additions & 1 deletion .github/actions/install-cli/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ runs:
if: runner.os == 'Windows'
run: |
npm install -g @aws-amplify/cli@${{ inputs.cli-version }}
$AMPLIFY_PATH=(Get-Command amplify).Path
# "where.exe" is used instead of "where" to disambiguate
# "where" is aliased to "Where-Object" in powershell, i.e. not pointing to the tool we want
# "amplify.cmd" is searched because "where.exe amplify" returns ambiguous list
$AMPLIFY_PATH=(where.exe amplify.cmd)
echo "AMPLIFY_PATH=$AMPLIFY_PATH"
"AMPLIFY_PATH=$AMPLIFY_PATH" >> $env:GITHUB_ENV
2 changes: 0 additions & 2 deletions .github/actions/run-smoke-tests-windows/README.md

This file was deleted.

53 changes: 0 additions & 53 deletions .github/actions/run-smoke-tests-windows/action.yml

This file was deleted.

9 changes: 0 additions & 9 deletions .github/actions/run-smoke-tests-windows/add_api_request.json

This file was deleted.

9 changes: 0 additions & 9 deletions .github/actions/run-smoke-tests-windows/add_auth_request.json

This file was deleted.

41 changes: 0 additions & 41 deletions .github/actions/run-smoke-tests-windows/windows-smoke-tests.sh

This file was deleted.

8 changes: 8 additions & 0 deletions .github/actions/run-smoke-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ runs:
echo "AMPLIFY_PATH=$AMPLIFY_PATH"
$AMPLIFY_PATH version
- name: Remove Pkg Fetch Checksum on Windows
shell: bash
if: runner.os == 'Windows'
run: |
cd scripts
yarn
yarn ts-node remove-pkg-fetch-checksum.ts
- name: Install Dependencies
shell: bash
run: yarn install --immutable
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/smoke-tests-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
os:
required: false
type: string
default: '["macos-latest-xl", "ubuntu-latest", "windows-latest"]'
default: '["macos-latest-xl", "ubuntu-latest", "amplify-cli_windows-latest_8-core"]'
versions:
required: false
type: string
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/smoke-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
os:
required: false
type: string
default: '["macos-latest-xl", "ubuntu-latest", "windows-latest"]'
default: '["macos-latest-xl", "ubuntu-latest", "amplify-cli_windows-latest_8-core"]'
versions:
required: false
type: string
Expand Down Expand Up @@ -40,14 +40,7 @@ jobs:
with:
cli-version: ${{ matrix.cli-version }}

- name: Run Smoke Tests Unix
if: runner.os != 'Windows'
- name: Run Smoke Tests
uses: ./.github/actions/run-smoke-tests
with:
role-to-assume: ${{ secrets.SMOKE_TESTS_ROLE_ARN }}

- name: Run Smoke Tests Windows
if: runner.os == 'Windows'
uses: ./.github/actions/run-smoke-tests-windows
with:
role-to-assume: ${{ secrets.SMOKE_TESTS_ROLE_ARN }}
2 changes: 1 addition & 1 deletion packages/amplify-e2e-core/src/utils/nexpect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ export function nspawn(command: string | string[], params: string[] = [], option
}

const testingWithLatestCodebase = isTestingWithLatestCodebase(command);
if (testingWithLatestCodebase || (process.platform === 'win32' && !command.endsWith('.exe'))) {
if (testingWithLatestCodebase || (process.platform === 'win32' && !(command.endsWith('.exe') || command.endsWith('.cmd')))) {
params.unshift(command);
command = getScriptRunnerPath(testingWithLatestCodebase);
}
Expand Down

0 comments on commit b08a945

Please sign in to comment.