fix stern install #314
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: test | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
env: | |
UV_SYSTEM_PYTHON: 1 | |
jobs: | |
ruff: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: eifinger/setup-uv@v1 | |
- run: uvx ruff check . | |
ruff-format: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: eifinger/setup-uv@v1 | |
- run: uvx ruff format . --check | |
build-image: | |
needs: [ruff, ruff-format] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and export | |
uses: docker/build-push-action@v5 | |
with: | |
file: resources/images/commander/Dockerfile | |
context: . | |
tags: bitcoindevproject/warnet-commander:latest | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
outputs: type=docker,dest=/tmp/commander.tar | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: commander | |
path: /tmp/commander.tar | |
test: | |
needs: [build-image] | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
test: | |
- conf_test.py | |
- dag_connection_test.py | |
- logging_test.py | |
- rpc_test.py | |
- services_test.py | |
- signet_test.py | |
- scenarios_test.py | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: azure/[email protected] | |
- name: start minikube | |
uses: medyagh/setup-minikube@latest | |
id: minikube | |
with: | |
cpus: max | |
memory: 4000m | |
- name: Download commander artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: commander | |
path: /tmp | |
- uses: eifinger/setup-uv@v1 | |
- name: Install project | |
run: uv sync --all-extras --dev | |
- name: Install commander image | |
run: | | |
echo loading commander image into minikube docker | |
eval $(minikube -p minikube docker-env) | |
docker load --input /tmp/commander.tar | |
docker image ls -a | |
- name: Run tests | |
run: | | |
source .venv/bin/activate | |
./test/${{matrix.test}} | |
- name: Collect Kubernetes logs | |
if: always() | |
run: | | |
echo "Installing stern..." | |
STERN_VERSION="1.30.0" | |
curl -Lo stern.tar.gz https://github.com/stern/stern/releases/download/v${STERN_VERSION}/stern_${STERN_VERSION}_linux_amd64.tar.gz | |
tar zxvf stern.tar.gz | |
chmod +x stern | |
sudo mv stern /usr/local/bin/ | |
# Run script | |
curl -O https://raw.githubusercontent.com/willcl-ark/warnet/main/resources/scripts/k8s-log-collector.sh | |
chmod +x k8s-log-collector.sh | |
./k8s-log-collector.sh default | |
- name: Upload log artifacts | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: kubernetes-logs-${{ matrix.test }} | |
path: ./k8s-logs | |
retention-days: 5 |