Skip to content

Commit

Permalink
Remove unused/old files (#82)
Browse files Browse the repository at this point in the history
- we don't use Sonar any more
- Makefile and rename.sh are also not really used; use tox.ini or snapcraft directly.
- update check.yaml to follow our latest conventions
- we don't really use pre-commit any more, or the tox dev-environment target
  • Loading branch information
samuelallan72 authored Sep 17, 2024
1 parent 0551fcb commit 7b4a4a1
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 157 deletions.
90 changes: 75 additions & 15 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Check workflow running linter, unit and functional tests
name: Tests

on:
workflow_call:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened]
branches: [master, main]
branches: [main]
paths-ignore:
- "**.md"
- "**.rst"
Expand All @@ -15,22 +15,82 @@ 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 }}
tox-version: "<4"
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:
uses: canonical/bootstack-actions/.github/workflows/func.yaml@v2
needs: lint-unit
with:
command: make functional
juju-channel: "3.4/stable"
nested-containers: true
python-version: "3.10"
timeout-minutes: 60
name: Functional tests
needs:
- lint
- 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 functional tests
run: tox -e func
17 changes: 0 additions & 17 deletions .github/workflows/sonar.yaml

This file was deleted.

22 changes: 0 additions & 22 deletions .pre-commit-config.yaml

This file was deleted.

64 changes: 0 additions & 64 deletions Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion README-SNAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ choose either of the following two backends for snapcraft:
To build the snap:

```shell
make build
snapcraft --use-lxd
```

To try the snap that was built, you can install it locally:
Expand Down
17 changes: 0 additions & 17 deletions rename.sh

This file was deleted.

8 changes: 0 additions & 8 deletions sonar-project.properties

This file was deleted.

13 changes: 0 additions & 13 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,6 @@ skip_missing_interpreters = True
basepython = python3
setenv = PYTHONPATH={toxinidir}

[testenv:dev-environment]
deps =
pre-commit
{[testenv:lint]deps}
{[testenv:unit]deps}
{[testenv:func]deps}
commands =
pre-commit install

[testenv:pre-commit]
deps = {[testenv:dev-environment]deps} # ensure that dev-environment is installed
commands = pre-commit run --all-files

[testenv:lint]
commands =
pflake8
Expand Down

0 comments on commit 7b4a4a1

Please sign in to comment.