Skip to content

Commit

Permalink
Add CI for Kubernetes
Browse files Browse the repository at this point in the history
  • Loading branch information
wvengen committed Feb 15, 2024
1 parent 09cbced commit 4336530
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
41 changes: 41 additions & 0 deletions .github/workflows/test-k8s.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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
2 changes: 1 addition & 1 deletion scrapyd_k8s.sample-k8s.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ launcher = scrapyd_k8s.launcher.K8s
# Namespace to work in (needs to exist).
namespace = scrapyd
# Optional pull secret, in case you have private spiders.
pull_secret = ghcr-registry
#pull_secret = ghcr-registry

# For each project, define a project section.
# This contains a repository that points to the remote container repository.
Expand Down

0 comments on commit 4336530

Please sign in to comment.