Benchmark #5
This file contains hidden or 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: Benchmark | |
on: | |
workflow_dispatch: | |
inputs: | |
branch: | |
description: 'Branch to benchmark' | |
required: true | |
default: 'main' | |
type: string | |
schedule: | |
- cron: '0 0 * * SAT' | |
permissions: | |
contents: read | |
jobs: | |
benchmark: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.branch || 'main' }} | |
- name: Set up Python | |
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 | |
with: | |
python-version: '3.11' # OCI cli needs distutils | |
- name: Install OCI CLI | |
run: | | |
bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)" -- --accept-all-defaults | |
- name: Add the OCI CLI to the PATH | |
run: | | |
echo "${HOME}/bin" >> $GITHUB_PATH | |
- uses: taiki-e/install-action@4a7eafa27f0bd6857fe4f46dad5c66568c426ac0 # v2.49.22 | |
with: | |
tool: wash | |
- name: Create kind cluster | |
uses: helm/kind-action@ae94020eaf628e9b9b9f341a10cc0cdcf5c018fb # v1.11.0 | |
with: | |
version: 'v0.26.0' | |
- name: Install clusterctl | |
run: | | |
curl -L https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.9.4/clusterctl-linux-amd64 -o clusterctl | |
chmod +x clusterctl | |
sudo mv clusterctl /usr/local/bin/ | |
- name: Init clusterctl | |
env: | |
OCI_CREDENTIALS_KEY: ${{ secrets.OCI_CREDENTIALS_KEY }} | |
OCI_CREDENTIALS_FINGERPRINT: ${{ secrets.OCI_CREDENTIALS_FINGERPRINT }} | |
OCI_USER_ID: ${{ secrets.OCI_USER_ID }} | |
run: ./ci/setup-cluster-api.sh | |
- name: Run and print benchmarks | |
env: | |
OCI_CLI_KEY_CONTENT: ${{ secrets.OCI_CREDENTIALS_KEY }} | |
OCI_CLI_FINGERPRINT: ${{ secrets.OCI_CREDENTIALS_FINGERPRINT }} | |
OCI_CLI_USER: ${{ secrets.OCI_USER_ID }} | |
run: ./ci/run-benchmarks.sh | |
# This should get run on exit from the script, but just in case, we run it again here too to | |
# ensure we clean up after ourselves | |
- name: Teardown cluster | |
if: ${{ always() }} | |
run: ./ci/delete-cluster.sh | |
env: | |
OCI_CLI_KEY_CONTENT: ${{ secrets.OCI_CREDENTIALS_KEY }} | |
OCI_CLI_FINGERPRINT: ${{ secrets.OCI_CREDENTIALS_FINGERPRINT }} | |
OCI_CLI_USER: ${{ secrets.OCI_USER_ID }} |