From c53e73310406e515a470955779f8e6020d2e5eb6 Mon Sep 17 00:00:00 2001 From: "soleng-terraform[bot]" <168111096+soleng-terraform[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2024 10:34:58 -0300 Subject: [PATCH] Update centrally managed files (#49) * update .github/workflows/check.yaml * update .gitignore * update .github/workflows/check.yaml * update .gitignore * update .github/workflows/check.yaml * update .gitignore * update .github/workflows/check.yaml * update .gitignore * update .github/workflows/check.yaml * update .gitignore * update .github/workflows/check.yaml * update .gitignore * update .github/workflows/check.yaml * update .gitignore * update .github/workflows/check.yaml * update .gitignore * update .github/workflows/check.yaml * update .gitignore * update .github/workflows/check.yaml * update .gitignore * update .github/workflows/check.yaml --------- Co-authored-by: soleng-terraform[bot] <168111096+soleng-terraform[bot]@users.noreply.github.com> Co-authored-by: Samuel Allan --- .github/workflows/check.yaml | 63 ++++++++++++++++++++++++++++++++---- .gitignore | 52 +++++++++++++++++++++++------ 2 files changed, 99 insertions(+), 16 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index f8e76c2..6b4d244 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -20,17 +20,62 @@ concurrency: cancel-in-progress: true jobs: - lint-unit: - uses: canonical/bootstack-actions/.github/workflows/lint-unit.yaml@v2 + lint: + name: Lint strategy: fail-fast: false matrix: python-version: ["3.8", "3.10"] - with: - python-version: ${{ matrix.python-version }} + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + # pin tox to the current major version to avoid + # workflows breaking all at once when a new major version is released. + python -m pip install 'tox<5' + + - name: Run linters + run: tox -e lint + + unit: + name: Unit + strategy: + fail-fast: false + matrix: + python-version: ["3.8", "3.10"] + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install 'tox<5' + + - name: Run unit tests + run: tox -e unit func: - needs: lint-unit + needs: + - lint + - unit name: functional tests runs-on: ${{ matrix.runs-on }} timeout-minutes: 120 @@ -38,7 +83,7 @@ jobs: fail-fast: false matrix: runs-on: [[ubuntu-22.04]] - test-command: ['tox -e func -- --series focal -v', 'tox -e func -- --series jammy -v'] + test-command: ['tox -e func -- -v --series focal', 'tox -e func -- -v --series jammy'] juju-channel: ["3.4/stable"] steps: @@ -76,6 +121,12 @@ jobs: - name: Run tests run: | + # These variables are for a consistent method to find the charm file(s) across all projects. + # It is designed to work both with charms that output one file per base, + # and charms that output a single file to run on all bases. + # Not all charms will use them, and for some charms the variables will resolve to the same file. + export CHARM_PATH_NOBLE="$(pwd)/$(ls | grep '.*24.04.*\.charm$')" + echo "$CHARM_PATH_NOBLE" export CHARM_PATH_JAMMY="$(pwd)/$(ls | grep '.*22.04.*\.charm$')" echo "$CHARM_PATH_JAMMY" export CHARM_PATH_FOCAL="$(pwd)/$(ls | grep '.*20.04.*\.charm$')" diff --git a/.gitignore b/.gitignore index de349ad..042b19d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,45 @@ -.jujuignore -.vscode/ +# This file is centrally managed as a template file in https://github.com/canonical/solutions-engineering-automation +# To update the file: +# - Edit it in the canonical/solutions-engineering-automation repository. +# - Open a PR with the changes. +# - When the PR merges, the soleng-terraform bot will open a PR to the target repositories with the changes. + +# Python Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# Test files and directories +.pytest_cache/ +.coverage +.tox +reports/ +**/report/ +htmlcov/ +.mypy_cache + +# python virtual environments (for local dev) +.venv +venv +env + +# Build artefacts +output/ .build/ -.tox/ -.venv/ build/ -env/ -venv/ -__pycache__/ *.charm -.coverage -report/ -.pytest_cache +*.snap +# python build artefacts +deb_dist/ +dist/ +*.egg-info/ + +# Log files +*.log + +# general backup files +*~ +*.bak + +# Note: for editor-specific files, please don't add them here, as they are specific to your environment, not the project. +# Instead, consider using a global gitignore on your workstation.