Add Spectral scan to github workflow #2722
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
name: Tanzu CLI Core E2E Tests | |
on: | |
pull_request: | |
branches: [main, release-*] | |
push: | |
branches: [ main, test*, release-*] | |
jobs: | |
build: | |
name: Tanzu CLI Core E2E Tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v1 | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.21 | |
id: go | |
- name: go cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Setup dependencies | |
run: | | |
make tools | |
echo "${PWD}/hack/tools/bin" >> $GITHUB_PATH | |
echo "${PWD}/bin" >> $GITHUB_PATH | |
- name: Build CLI Core | |
run: | | |
make build | |
- name: Start local OCI registry | |
run: | | |
make start-test-central-repo | |
- name: Run CLI E2E Tests | |
env: | |
TANZU_API_TOKEN: ${{ secrets.TANZU_API_TOKEN }} | |
TANZU_CLI_TMC_UNSTABLE_URL: ${{ secrets.TANZU_CLI_TMC_UNSTABLE_URL }} | |
run: | | |
make e2e-cli-core | |
- name: Tests Results Summary | |
if: always() | |
run: | | |
TEST_RESULTS_MD=$(./hack/scripts/process-ginkgo-test-results.sh ./test/e2e/testresults) | |
echo "$TEST_RESULTS_MD" >> $GITHUB_STEP_SUMMARY | |
if [[ $TEST_RESULTS_MD == *":x:"* ]]; then | |
exit 1 | |
fi |