-
Notifications
You must be signed in to change notification settings - Fork 514
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* github-actions: use ec github secret * vault free * typo (cherry picked from commit 9cc9984) # Conflicts: # .github/workflows/generate-smoke-tests-list/action.yml # .github/workflows/setup-cluster-env/action.yml # .github/workflows/smoke-tests-ess.yml # .github/workflows/smoke-tests-os.yml Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
- Loading branch information
1 parent
a61dfe5
commit 7484685
Showing
5 changed files
with
196 additions
and
14 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
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
|
||
name: generate-smoke-tests-list | ||
description: Generate smoke tests list | ||
|
||
inputs: | ||
aws-csv-file: | ||
description: 'Content with the AWS csv file' | ||
required: true | ||
aws-profile: | ||
description: 'aws profile' | ||
required: true | ||
outputs: | ||
tests: | ||
description: "List of smoke tests" | ||
value: ${{ steps.generate.outputs.tests }} | ||
date: | ||
description: "Current date" | ||
value: ${{ steps.generate.outputs.date }} | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Setup cluster env | ||
uses: ./.github/workflows/setup-cluster-env | ||
with: | ||
aws-csv-file: ${{ inputs.aws-csv-file }} | ||
aws-profile: ${{ inputs.aws-profile }} | ||
- id: generate | ||
name: Generate matrix and date | ||
run: | | ||
# remove the full path and use a relative path instead to be github runner agnostic | ||
echo "tests=$(make smoketest/discover | sed "s#${GITHUB_WORKSPACE}/#./#g")" >> "${GITHUB_OUTPUT}" | ||
echo "date=$(date +%s)" >> "${GITHUB_OUTPUT}" | ||
shell: 'bash' |
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
|
||
name: setup-cluster-env | ||
description: Setup cluster env | ||
|
||
inputs: | ||
aws-csv-file: | ||
description: 'Content with the AWS csv file' | ||
required: true | ||
aws-profile: | ||
description: 'aws profile' | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: go.mod | ||
cache-dependency-path: | | ||
go.sum | ||
tools/go.sum | ||
- name: Configure AWS account | ||
run: | | ||
echo "${AWS_ACCOUNT_IMPORT}" > ${{ runner.temp }}/account.csv; | ||
sed -i 's/User name/User Name/g' ${{ runner.temp }}/account.csv; | ||
aws configure import --csv file://${{ runner.temp }}/account.csv; | ||
echo 'AWS_ACCOUNT_IMPORT=' >> ${GITHUB_ENV}; | ||
rm -f ${{ runner.temp }}/account.csv; | ||
shell: 'bash' | ||
env: | ||
AWS_ACCOUNT_IMPORT: ${{ inputs.aws-csv-file }} | ||
AWS_PROFILE: ${{ inputs.aws-profile }} |
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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: smoke-tests-ess | ||
run-name: Smoke Tests ESS | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
branch: | ||
required: true | ||
type: string | ||
|
||
|
||
# limit the access of the generated GITHUB_TOKEN | ||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
prepare: | ||
name: Generate smoke tests list | ||
runs-on: ubuntu-latest | ||
outputs: | ||
tests: ${{ steps.generate.outputs.tests }} | ||
date: ${{ steps.generate.outputs.date }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.branch }} | ||
- id: generate | ||
name: Generate matrix and date | ||
uses: ./.github/workflows/generate-smoke-tests-list | ||
with: | ||
aws-csv-file: ${{ secrets.OBSERVABILITY_AWS_CSV_FILE }} | ||
aws-profile: ${{ secrets.OBSERVABILITY_AWS_PROFILE }} | ||
|
||
smoke-tests-ess: | ||
name: Run smoke tests ${{ matrix.test }} for ${{ matrix.version }} | ||
runs-on: ubuntu-latest | ||
needs: prepare | ||
env: | ||
TF_VAR_BUILD_ID: ${{ github.run_id }} | ||
TF_VAR_ENVIRONMENT: 'ci' | ||
TF_VAR_BRANCH: ${{ github.ref_name }} | ||
TF_VAR_REPO: ${{ github.repository }} | ||
TF_VAR_CREATED_DATE: ${{ needs.prepare.outputs.date }} | ||
# TODO: use keyless | ||
EC_API_KEY: ${{ secrets.OBSERVABILITY_EC_API_KEY }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
test: ${{ fromJSON(needs.prepare.outputs.tests) }} | ||
version: | ||
- '7.17' | ||
- 'latest' | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.branch }} | ||
- name: Setup cluster env | ||
uses: ./.github/workflows/setup-cluster-env | ||
with: | ||
aws-csv-file: ${{ secrets.OBSERVABILITY_AWS_CSV_FILE }} | ||
aws-profile: ${{ secrets.OBSERVABILITY_AWS_PROFILE }} | ||
- name: Run smoke tests ${{ matrix.test }} for ${{ matrix.version }} | ||
run: make smoketest/run-version TEST_DIR=${{ matrix.test }} SMOKETEST_VERSION=${{ matrix.version }} | ||
- if: always() | ||
name: Teardown smoke test infra | ||
run: make smoketest/cleanup TEST_DIR=${{ matrix.test }} |
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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: smoke-tests-os | ||
run-name: Smoke Tests OS | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
branch: | ||
required: true | ||
type: string | ||
|
||
# limit the access of the generated GITHUB_TOKEN | ||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
prepare: | ||
name: Generate smoke tests list | ||
runs-on: ubuntu-latest | ||
outputs: | ||
tests: ${{ steps.generate.outputs.tests }} | ||
date: ${{ steps.generate.outputs.date }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.branch }} | ||
- id: generate | ||
name: Generate matrix and date | ||
uses: ./.github/workflows/generate-smoke-tests-list | ||
with: | ||
aws-csv-file: ${{ secrets.OBSERVABILITY_AWS_CSV_FILE }} | ||
aws-profile: ${{ secrets.OBSERVABILITY_AWS_PROFILE }} | ||
|
||
smoke-tests-os: | ||
name: Run smoke tests OS | ||
runs-on: ubuntu-latest | ||
needs: prepare | ||
env: | ||
TF_VAR_BUILD_ID: ${{ github.run_id }} | ||
TF_VAR_ENVIRONMENT: 'ci' | ||
TF_VAR_BRANCH: ${{ github.ref_name }} | ||
TF_VAR_REPO: ${{ github.repository }} | ||
TF_VAR_CREATED_DATE: ${{ needs.prepare.outputs.date }} | ||
# TODO: use keyless | ||
EC_API_KEY: ${{ secrets.OBSERVABILITY_EC_API_KEY }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ inputs.branch }} | ||
- name: Get version | ||
run: echo "VERSION=$(make get-version)" >> "${GITHUB_ENV}" | ||
- name: Setup cluster env | ||
uses: ./.github/workflows/setup-cluster-env | ||
with: | ||
aws-csv-file: ${{ secrets.OBSERVABILITY_AWS_CSV_FILE }} | ||
aws-profile: ${{ secrets.OBSERVABILITY_AWS_PROFILE }} | ||
- name: Run smoke tests OS | ||
working-directory: ${{ github.workspace }}/testing/smoke/supported-os | ||
run: ./test.sh ${VERSION}-SNAPSHOT |