Add CI for Kubernetes #1
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: Tests on Docker | |
on: | |
push: | |
pull_request: | |
jobs: | |
container: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
cache: 'pip' | |
- name: Install dependencies | |
run: | | |
pip install -r requirements.txt | |
pip install -r requirements-test.txt | |
- name: Start minikube | |
uses: medyagh/setup-minikube@master | |
- name: Prepare Kubernetes environment | |
run: | | |
kubectl create namespace scrapyd | |
kubectl create secret -n scrapyd generic example-env-secret --from-literal=FOO_1=bar | |
kubectl create configmap -n scrapyd example-env-secret --from-literal=FOO_2=baz | |
- name: Run scrapyd-k8s | |
run: | | |
cp scrapyd_k8s.sample-k8s.conf scrapyd_k8s.conf | |
python -m scrapyd_k8s & | |
sleep 1 | |
curl http://localhost:6800/daemonstatus.json | |
- name: Run tests | |
run: pytest -vv test_api.py |