test: Add TLS Requirer to integration tests #96
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: CI | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
# The branches below must be a subset of the branches above | |
branches: ["main"] | |
jobs: | |
lint-report: | |
name: Lint report | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install tox | |
run: pip install tox | |
- name: Run tests using tox | |
run: tox -e lint | |
static-analysis: | |
name: Static analysis | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install tox | |
run: pip install tox | |
- name: Run tests using tox | |
run: tox -e static | |
unit-tests-with-coverage: | |
name: Unit tests | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install tox | |
run: pip install tox | |
- name: Run tests using tox | |
run: tox -e unit | |
integration-test: | |
name: Integration tests | |
runs-on: ubuntu-22.04 | |
needs: | |
- lint-report | |
- static-analysis | |
- unit-tests-with-coverage | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup LXD | |
uses: canonical/setup-lxd@main | |
- name: Setup operator environment | |
uses: charmed-kubernetes/actions-operator@main | |
with: | |
provider: microk8s | |
channel: 1.28-strict/stable | |
juju-channel: 3.3/stable | |
- name: Run integration tests | |
run: tox -e integration | |
- name: Archive Tested Charm | |
uses: actions/upload-artifact@v4 | |
if: ${{ github.event_name == 'push' }} | |
with: | |
name: tested-charm | |
path: .tox/**/httprequest-lego-k8s_ubuntu-22.04-amd64.charm | |
retention-days: 5 | |
- name: Archive charmcraft logs | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: charmcraft-logs | |
path: /home/runner/.local/state/charmcraft/log/*.log | |
- name: Archive juju crashdump | |
if: failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: juju-crashdump | |
path: juju-crashdump-*.tar.xz | |
publish-charm: | |
name: Publish Charm | |
needs: | |
- lint-report | |
- static-analysis | |
- unit-tests-with-coverage | |
- integration-test | |
runs-on: ubuntu-22.04 | |
if: ${{ github.event_name == 'push' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install charmcraft | |
run: sudo snap install charmcraft --classic | |
- name: Fetch Tested Charm | |
uses: actions/download-artifact@v4 | |
with: | |
name: tested-charm | |
- name: Move charm in current directory | |
run: find ./ -name httprequest-lego-k8s_ubuntu-22.04-amd64.charm -exec mv -t ./ {} \; | |
- name: Select Charmhub channel | |
uses: canonical/charming-actions/[email protected] | |
id: channel | |
- name: Upload charm to Charmhub | |
uses: canonical/charming-actions/[email protected] | |
with: | |
credentials: "${{ secrets.CHARMHUB_TOKEN }}" | |
github-token: "${{ secrets.GITHUB_TOKEN }}" | |
channel: "${{ steps.channel.outputs.name }}" |