-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(testing): convert CI testing to use Makefile actions (#3579)
* chore: try manually updating one GHA workflow to use make * trivial edit so ai-platform/snippets tests are not skipped. * remove empty stanza * pushing, to refresh workflows. adding workflow dispatch for another testing option. * add env var for gcp project * directory name typo * update shared workflow to use Make * update unique workflows, and the util template these workflows do not use the shared test.yaml, and have slight customizations. Also cleans up some trailing whitespace found in these files. * fix bracket spacing * fix functions/slack directory * add path match for shared test.yaml workflow * add path match for reused workflow test.yaml * add c8 as a dev dependency for packages that use it for testing * fix: use the right project * run toplevel npm install before installing sample deps * Apply suggestions from code review Co-authored-by: Patti Shin <[email protected]> --------- Co-authored-by: Patti Shin <[email protected]>
- Loading branch information
Showing
114 changed files
with
351 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,9 +39,6 @@ jobs: | |
permissions: | ||
contents: 'read' | ||
id-token: 'write' | ||
defaults: | ||
run: | ||
working-directory: 'ai-platform/snippets' | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
|
@@ -64,30 +61,26 @@ jobs: | |
- name: Get npm cache directory | ||
id: npm-cache-dir | ||
shell: bash | ||
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} | ||
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT} | ||
- uses: actions/cache@v3 | ||
id: npm-cache | ||
with: | ||
path: ${{ steps.npm-cache-dir.outputs.dir }} | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: install repo dependencies | ||
run: npm install | ||
working-directory: . | ||
- name: install directory dependencies | ||
run: npm install | ||
- run: npm run build --if-present | ||
- name: set env vars for scheduled run | ||
if: github.event.action == 'schedule' | ||
run: | | ||
echo "MOCHA_REPORTER_SUITENAME=ai-platform-snippets" >> $GITHUB_ENV | ||
echo "MOCHA_REPORTER_OUTPUT=${{github.run_id}}_sponge_log.xml" >> $GITHUB_ENV | ||
echo "MOCHA_REPORTER=xunit" >> $GITHUB_ENV | ||
- run: npm test | ||
- name: Run Tests | ||
run: make test dir=ai-platform/snippets | ||
env: | ||
GOOGLE_SAMPLES_PROJECT: "long-door-651" | ||
LOCATION: ${{ steps.secrets.outputs.location }} | ||
CAIP_PROJECT_ID: ${{ steps.secrets.outputs.caip_id }} | ||
CAIP_PROJECT_ID: ${{ steps.secrets.outputs.caip_id }} | ||
- name: upload test results for FlakyBot workflow | ||
if: github.event.action == 'schedule' && always() | ||
uses: actions/upload-artifact@v3 | ||
|
@@ -96,7 +89,7 @@ jobs: | |
with: | ||
name: test-results | ||
path: ai-platform/snippets/${{ env.MOCHA_REPORTER_OUTPUT }} | ||
retention-days: 1 | ||
retention-days: 1 | ||
flakybot: | ||
permissions: | ||
contents: 'read' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.