From a23fe1d80418e27ab0e644fbe326d1eae18d1822 Mon Sep 17 00:00:00 2001 From: TrezorHannes Date: Sat, 11 Jan 2025 22:40:39 +0100 Subject: [PATCH 1/2] Add GitHub workflows and Dependabot configuration --- .github/dependabot.yml | 11 ++++++++ .github/workflows/formatting.yml | 25 ++++++++++++++++++ .github/workflows/testing-linting.yml | 37 +++++++++++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/formatting.yml create mode 100644 .github/workflows/testing-linting.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..efb58eb --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +version: 2 +updates: + - package-ecosystem: "pip" + directory: "/" # Root directory of your repository + schedule: + interval: "weekly" # Check for updates once a week + + - package-ecosystem: "github-actions" + directory: "/" # Monitors actions used in workflows + schedule: + interval: "weekly" \ No newline at end of file diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml new file mode 100644 index 0000000..de1f752 --- /dev/null +++ b/.github/workflows/formatting.yml @@ -0,0 +1,25 @@ +name: Formatting Check + +on: + pull_request: + branches: + - main + - dev + +jobs: + format: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.10 + + - name: Install black + run: pip install black + + - name: Check formatting + run: black --check . diff --git a/.github/workflows/testing-linting.yml b/.github/workflows/testing-linting.yml new file mode 100644 index 0000000..60e56b2 --- /dev/null +++ b/.github/workflows/testing-linting.yml @@ -0,0 +1,37 @@ +name: Testing and Linting + +on: + push: + branches: + - main + - dev + pull_request: + branches: + - main + - dev + +jobs: + test-and-lint: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.8, 3.9, 3.10] + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pytest flake8 + + - name: Run tests + run: pytest + + - name: Lint with flake8 + run: flake8 . \ No newline at end of file From 76de7b22940c47d3846484d456b03475ad0a8333 Mon Sep 17 00:00:00 2001 From: TrezorHannes Date: Sat, 11 Jan 2025 23:17:08 +0100 Subject: [PATCH 2/2] Simplify workflows by removing flake8 --- .github/workflows/formatting.yml | 2 +- .../workflows/{testing-linting.yml => testing.yml} | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) rename .github/workflows/{testing-linting.yml => testing.yml} (71%) diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml index de1f752..9eac5cf 100644 --- a/.github/workflows/formatting.yml +++ b/.github/workflows/formatting.yml @@ -8,7 +8,7 @@ on: jobs: format: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/testing-linting.yml b/.github/workflows/testing.yml similarity index 71% rename from .github/workflows/testing-linting.yml rename to .github/workflows/testing.yml index 60e56b2..45580b0 100644 --- a/.github/workflows/testing-linting.yml +++ b/.github/workflows/testing.yml @@ -1,4 +1,4 @@ -name: Testing and Linting +name: Testing on: push: @@ -11,11 +11,11 @@ on: - dev jobs: - test-and-lint: - runs-on: ubuntu-latest + test: + runs-on: ubuntu-22.04 strategy: matrix: - python-version: [3.8, 3.9, 3.10] + python-version: [3.8, 3.9, 3.10, 3.11] steps: - name: Checkout code uses: actions/checkout@v4 @@ -28,10 +28,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install pytest flake8 + pip install pytest - name: Run tests run: pytest - - - name: Lint with flake8 - run: flake8 . \ No newline at end of file