[WIP] k8s workflow tests #15
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: Regression Detector - Ephemeral CDK Devnet | |
jobs: | |
deploy_devnet: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.event.before }} | |
- name: Set up Docker | |
uses: docker/setup-buildx-action@v1 | |
- name: Setup Google Cloud SDK | |
uses: 'google-github-actions/setup-gcloud@v2' | |
with: | |
version: '>= 363.0.0' | |
- uses: 'google-github-actions/auth@v2' | |
with: | |
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS }}' | |
project_id: 'prj-polygonlabs-devtools-dev' | |
- name: Install kubectl and gcloud kubectl auth plugin | |
run: | | |
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" \ | |
&& sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl && gcloud components install gke-gcloud-auth-plugin | |
- name: Install tomlq for config file preparation | |
run: | | |
pip3 install tomlq | |
- name: Clone private kurtosis-cdk repo | |
run: | | |
eval `ssh-agent -s` | |
ssh-add - <<< '${{ secrets.SSH_PRIVATE_KEY }}' | |
git clone -b dan/contracts_running_state [email protected]:0xPolygon/kurtosis-cdk.git | |
## add necessary manipulation steps here... | |
- name: Install kurtosis | |
run: | | |
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list | |
sudo apt update | |
sudo apt install kurtosis-cli | |
- name: Setup necessary gke custom kurtosis netorking configs | |
run: | | |
export KURTOSIS_CONFIG_PATH="$(kurtosis config path)" | |
cp /home/runner/work/bor/bor/kurtosis-config.yml $KURTOSIS_CONFIG_PATH | |
- name: Set kurtosis cloud env | |
run: | | |
mkdir -p ~/.kube | |
echo "${{ secrets.GKE_CLUSTER_CREDENTIALS }}" > ~/.kube/config | |
export KUBECONFIG=~/.kube/config && kurtosis cluster set cloud | |
- name: Run kurtosis agent in background | |
run: | | |
kurtosis gateway & # Run cmd in background | |
sleep 10 | |
- name: REMOVE, temp for CI testing remove all devnet resources | |
run: | | |
cd kurtosis-cdk | |
kurtosis clean -a | |
sleep 180 | |
- name: Deploy CDK devnet to isolated GKE namespace | |
run: | | |
cd kurtosis-cdk | |
kurtosis engine restart | |
kurtosis run --enclave cdk-v1 --args-file params.yml . | |
sleep 600 | |
- name: Finally, remove all devnet resources | |
run: | | |
cd kurtosis-cdk | |
kurtosis clean -a |