Skip to content

Commit

Permalink
install redis on CI
Browse files Browse the repository at this point in the history
separate each backend installation
  • Loading branch information
minrk committed Jan 19, 2024
1 parent 4e791db commit 3549811
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ env:
jobs:
# Run "pytest tests" for various Python versions
pytest:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 30
strategy:
# Keep running even if one variation of the job fail
Expand Down Expand Up @@ -69,21 +69,35 @@ jobs:
python -m jupyterhub_traefik_proxy.install --output=./bin
pip freeze
- name: Install etcd, consul
- name: Install consul
if: matrix.backend == 'consul'
run: |
curl -L https://releases.hashicorp.com/consul/${CONSUL_VERSION}/consul_${CONSUL_VERSION}_linux_amd64.zip > consul.zip
unzip consul.zip -d ./bin consul
- name: Install etcd
if: matrix.backend == 'etcd'
run: |
curl -L https://github.com/etcd-io/etcd/releases/download/v${ETCD_DOWNLOAD_VERSION}/etcd-v${ETCD_DOWNLOAD_VERSION}-linux-amd64.tar.gz > etcd.tar.gz
tar -xzf etcd.tar.gz -C ./bin --strip-components=1 --wildcards '*/etcd*'
- name: Install redis
if: matrix.backend == 'redis'
# from https://redis.io/docs/install/install-redis/install-redis-on-linux/
run: |
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
sudo apt-get -y update
sudo apt-get -y install redis
- name: Select tests
run: |
if [[ ! -z "${{ matrix.backend }}" ]]; then
# select backend subset
echo "PYTEST_ADDOPTS=-k ${{ matrix.backend }}" >> "${GITHUB_ENV}"
else
# default: select everything _but_ the etcd/consul backend tests
echo "PYTEST_ADDOPTS=-k 'not etcd and not consul'" >> "${GITHUB_ENV}"
# default: select everything _but_ the KV backend tests
echo "PYTEST_ADDOPTS=-k 'not etcd and not consul and not redis'" >> "${GITHUB_ENV}"
fi
- name: Run tests
Expand Down

0 comments on commit 3549811

Please sign in to comment.