Update readme and CSV file for 5.12.0 #1953
Workflow file for this run
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: (E2E) K8s Distribution Tests | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- "**.md" | |
pull_request_target: | |
types: | |
- labeled | |
branches: | |
- main | |
- 'release/**' | |
paths-ignore: | |
- "**.md" | |
pull_request: | |
types: | |
- labeled | |
branches: | |
- main | |
- 'release/**' | |
paths-ignore: | |
- "**.md" | |
permissions: | |
contents: write | |
pages: write | |
id-token: write | |
actions: write | |
env: | |
AWS_REGION: us-east-1 | |
jobs: | |
decide-run-tests: | |
name: Decide to run tests | |
runs-on: ubuntu-22.04 | |
outputs: | |
RUN_TESTS: ${{ steps.should-run-tests.outputs.RUN_TESTS }} | |
if: >- | |
( !cancelled() | |
&& ((github.event_name == 'pull_request_target' | |
&& github.event.label.name == 'run-all-test' | |
&& github.event.pull_request.head.repo.full_name != github.repository) | |
|| | |
(github.event_name == 'pull_request' | |
&& github.event.label.name == 'run-all-test' | |
&& github.event.pull_request.head.repo.full_name == github.repository) | |
|| | |
github.event_name == 'push' | |
|| | |
github.event_name == 'workflow_dispatch' | |
) | |
) | |
steps: | |
- name: Decide to run tests | |
id: should-run-tests | |
run: | | |
if [[ '${{ github.event_name }}' != 'push' ]]; then | |
echo "RUN_TESTS=true" >> $GITHUB_OUTPUT | |
exit 0 | |
fi | |
PR_NUMBER=$(echo "$COMMIT_MESSAGE" | grep -oP '\(#\K[0-9]*(?=\))') | |
PR_LABELS=$( (gh pr view https://github.com/${{github.repository}}/pull/${PR_NUMBER} --json labels | jq .labels[].name) || echo "Could not get PR labels") | |
for label in $PR_LABELS; do | |
# if full suite is ran before | |
if [[ "$label" == '"run-all-test"' ]]; then | |
echo "RUN_TESTS=false" >> $GITHUB_OUTPUT | |
exit 0 | |
fi | |
done | |
echo "RUN_TESTS=true" >> $GITHUB_OUTPUT | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
COMMIT_MESSAGE: ${{ github.event.commits[0].message }} | |
- name: Print decision | |
run: echo "Run tests= ${{ steps.should-run-tests.outputs.RUN_TESTS }}" | |
run-aks: | |
needs: decide-run-tests | |
if: needs.decide-run-tests.outputs.RUN_TESTS == 'true' | |
uses: ./.github/workflows/e2e-aks.yaml | |
secrets: inherit | |
run-eks: | |
needs: decide-run-tests | |
if: needs.decide-run-tests.outputs.RUN_TESTS == 'true' | |
uses: ./.github/workflows/e2e-eks.yaml | |
secrets: inherit | |
run-gke: | |
needs: decide-run-tests | |
if: needs.decide-run-tests.outputs.RUN_TESTS == 'true' | |
uses: ./.github/workflows/e2e-gke.yaml | |
secrets: inherit | |
update-test-run-status-badges: | |
needs: [run-aks, run-eks, run-gke] | |
if: always() && needs.decide-run-tests.outputs.RUN_TESTS == 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4.0.2 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ env.AWS_REGION }} | |
- name: Get Secrets | |
uses: aws-actions/aws-secretsmanager-get-secrets@v2 | |
with: | |
secret-ids: | | |
TEST_STATUSES_GIST_ID,CN/TEST_STATUSES_GIST_ID | |
GIST_CREATION_TOKEN,CN/GIST_CREATION_TOKEN | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Update Status Badges | |
run: | | |
source .github/scripts/utils.sh | |
update_status_badges ${{ github.run_id }} ${{ env.TEST_STATUSES_GIST_ID }} ${{ env.GIST_CREATION_TOKEN }} | |
unit-tests: | |
name: Unit Tests | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: "1.21.0" | |
- name: Run unit tests | |
run: make test-unit | |
integration-tests: | |
name: Integration Tests | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' | |
strategy: | |
fail-fast: false | |
matrix: | |
edition: ["os", "ee"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: "1.21.0" | |
- name: Run integration tests | |
run: | | |
case ${{ matrix.edition }} in | |
os) GO_TEST_FLAGS='-ee=false';; | |
ee) GO_TEST_FLAGS='-ee=true';; | |
*) echo Unexpected edition: ${{ matrix.edition }} && exit 1;; | |
esac | |
make GO_TEST_FLAGS=${GO_TEST_FLAGS} test-it | |
slack_notify: | |
name: Slack Notify | |
timeout-minutes: 15 | |
needs: ["update-test-run-status-badges"] | |
if: failure() && github.event_name == 'push' | |
runs-on: ubuntu-latest | |
env: | |
ACTION_API_URL: ${{ github.api_url }}/repos/${{ github.repository }}/actions/workflows/k8s-dist-tests.yaml/runs?branch=main | |
ACTION_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
steps: | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4.0.2 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ env.AWS_REGION }} | |
- name: Get Secrets | |
uses: aws-actions/aws-secretsmanager-get-secrets@v2 | |
with: | |
secret-ids: | | |
SLACK_WEBHOOK_URL_CLOUD_NATIVE,CN/SLACK_WEBHOOK_URL_CLOUD_NATIVE | |
- name: decide to notify | |
id: decide | |
run: | | |
while true | |
do | |
curl_result=$(curl -sSL\ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: $GITHUB_TOKEN" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
${ACTION_API_URL}) | |
RESULT=$(echo $curl_result | jq -r 'first(.workflow_runs[] | select(.run_number < ${{ github.run_number }} )) | { conclusion, status, run_number}') | |
STATUS=$(echo $RESULT | jq -r .status) | |
if [[ $STATUS == "completed" ]]; then | |
break | |
fi | |
echo "status is $STATUS, sleeping 30 seconds" | |
sleep 30 | |
done | |
CONCLUSION=$(echo $RESULT | jq -r .conclusion) | |
LAST_RUN_NUMBER=$(echo $RESULT | jq -r .run_number) | |
if [[ $CONCLUSION == "success" ]]; then | |
echo "SEND_SLACK_MESSAGE=true" >> $GITHUB_OUTPUT | |
echo "LAST_RUN_NUMBER=$LAST_RUN_NUMBER" >> $GITHUB_OUTPUT | |
else | |
echo "SEND_SLACK_MESSAGE=false" >> $GITHUB_OUTPUT | |
fi | |
- uses: rtCamp/action-slack-notify@v2 | |
if: steps.decide.outputs.SEND_SLACK_MESSAGE == 'true' | |
env: | |
SLACK_CHANNEL: cloud-native-dev | |
SLACK_COLOR: red # or a specific color like 'green' or '#ff00ff' | |
SLACK_MESSAGE: '${{ github.actor}} broke the <${{ env.ACTION_RUN_URL }}|main branch> :bomb: previous successful run number was ${{ steps.decide.outputs.LAST_RUN_NUMBER }}' | |
SLACK_TITLE: Main Branch Broken | |
SLACK_USERNAME: rtCamp | |
SLACK_WEBHOOK: ${{ env.SLACK_WEBHOOK_URL_CLOUD_NATIVE }} | |
MSG_MINIMAL: true | |