Skip to content

Merge pull request #1242 from dimaqq/chore-remove-juju-loop #1309

Merge pull request #1242 from dimaqq/chore-remove-juju-loop

Merge pull request #1242 from dimaqq/chore-remove-juju-loop #1309

Workflow file for this run

name: Testing
on: [push, pull_request, workflow_dispatch]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-test:
name: Build test
runs-on: ubuntu-latest
strategy:
matrix:
python:
- "3.10"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- uses: astral-sh/[email protected]
- run: |
make build-test
validate:
name: Validate
runs-on: ubuntu-latest
strategy:
matrix:
python:
- "3.10"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- uses: astral-sh/[email protected]
- run: uvx -p ${{ matrix.python }} tox -e validate
unit-tests:
name: Unit tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- uses: astral-sh/[email protected]
- run: uvx -p ${{ matrix.python }} tox -e unit
integration:
name: Integration
needs: [unit-tests]
timeout-minutes: 150
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python:
# We will reduce the workload to 3.10 to
# save some resources for now.
# - "3.9"
- "3.10"
juju:
- "3.1/stable"
- "3.3/stable"
- "3.4/stable"
- "3.5/stable"
- "3.6/stable"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- uses: astral-sh/[email protected]
- uses: charmed-kubernetes/actions-operator@main
with:
provider: lxd
juju-channel: ${{ matrix.juju }}
# 2023-01-11 Commented until we discover a
# clear approach for this.
# - name: Set proxy in controller
# run: |
# set -euxo pipefail
# # build a squid config file
# CONTROLLER_IP=$(juju list-controllers --format yaml | yq '.controllers[.current-controller].recent-server' | awk -F '[:]' '{print $1}');
# echo "Controller IP is: $CONTROLLER_IP"
# PROXY=$CONTROLLER_IP:3128
# echo "Proxy address is: $PROXY"
# echo "acl all src all" > squid.conf
# echo "http_access allow all" >> squid.conf
# echo "http_port $PROXY" >> squid.conf
# cat squid.conf
# # copy to the controller and reconfigure it
# juju status -m controller
# juju switch controller
# juju ssh 0 "sudo apt-get install squid -y"
# juju scp squid.conf 0:/tmp/squid.conf
# juju ssh 0 "sudo mv /tmp/squid.conf /etc/squid/squid.conf"
# juju ssh 0 "sudo squid -k reconfigure"
# # Test curl after waiting
# sleep 10
# echo "Test proxy access"
# curl -s -o /dev/null -w "%{http_code}" --proxy http://$PROXY https://charmhub.io
# # set model defaults
# juju model-defaults apt-http-proxy=$PROXY apt-https-proxy=$PROXY juju-http-proxy=$PROXY juju-https-proxy=$PROXY snap-http-proxy=$PROXY snap-https-proxy=$PROXY
# juju model-defaults
- run: uvx -p ${{ matrix.python }} tox -e integration
integration-quarantine:
name: Quarantined Integration Tests
needs: [unit-tests]
timeout-minutes: 150
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python:
- "3.10"
juju:
- "3.1/stable"
- "3.3/stable"
- "3.4/stable"
- "3.5/stable"
- "3.6/stable"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- uses: astral-sh/[email protected]
- uses: charmed-kubernetes/actions-operator@main
with:
provider: lxd
juju-channel: ${{ matrix.juju }}
- run: uvx -p ${{ matrix.python }} tox -e integration-quarantine