From 8f176a5765193ef3f2b789c60e95824257d162e0 Mon Sep 17 00:00:00 2001 From: Diamantis Sellis Date: Tue, 7 Oct 2025 16:00:35 +0200 Subject: [PATCH] ci: simplify continuous integration workflows --- .github/workflows/check_formatting.yml | 28 ---------------- .github/workflows/ci.yml | 46 ++++++++++++++++++++++++++ .github/workflows/linting_flake8.yml | 27 --------------- .github/workflows/test.yml | 37 --------------------- 4 files changed, 46 insertions(+), 92 deletions(-) delete mode 100644 .github/workflows/check_formatting.yml create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/linting_flake8.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/check_formatting.yml b/.github/workflows/check_formatting.yml deleted file mode 100644 index 50ff215b1..000000000 --- a/.github/workflows/check_formatting.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: check yapf formatting - -on: - push: - branches: - - "main" - pull_request: - branches: - - "main" - - "**-dev" - - "feat**" -jobs: - check-formatting: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - name: Checkout repository - with: - fetch-depth: 0 - - uses: actions/setup-python@v2 - with: - python-version: "3.11" - - name: Display Python version - run: echo "##[set-output name=version;]$(python -c 'from Babylon.version import VERSION; print(VERSION)')" - - name: run YAPF to test if python code is correctly formatted - uses: AlexanderMelde/yapf-action@master - with: - args: --diff \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..7af7e58ed --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,46 @@ +name: Continuous Integration +permissions: + contents: read + +env: + BABYLON_SERVICE: ${{ vars.BABYLON_SERVICE }} + BABYLON_TOKEN: ${{ secrets.BABYLON_TOKEN }} + BABYLON_ORG_NAME: ${{ vars.BABYLON_ORG_NAME }} + +on: + workflow_dispatch: + push: + branches: + - "main" + pull_request: + branches: + - "main" + +jobs: + CI: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - uses: actions/setup-python@v6 + + - name: lint + uses: py-actions/flake8@v2 + with: + max-line-length: "120" + path: "Babylon" + + - name: format + uses: AlexanderMelde/yapf-action@master + with: + args: --diff + + - name: Install dependencies + run: | + python -m venv .venv + .venv/bin/pip install . + + - name: Run tests + run: | + . .venv/bin/activate + babylon namespace use -c test -p sphinx -s testid + pytest . Babylon/test/api/organizations/test_organizations_service.py \ No newline at end of file diff --git a/.github/workflows/linting_flake8.yml b/.github/workflows/linting_flake8.yml deleted file mode 100644 index 947e12d84..000000000 --- a/.github/workflows/linting_flake8.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: linting flake8 - -on: - push: - branches: - - "main" - pull_request: - branches: - - "main" - - "**-dev" - - "feat**" -jobs: - flake8-lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - name: Checkout repository - with: - fetch-depth: 0 - - uses: actions/setup-python@v2 - with: - python-version: "3.11" - - name: flake8 Lint Babylon - uses: py-actions/flake8@v2 - with: - max-line-length: "120" - path: "Babylon" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index fc911264b..000000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Test Api commands babylon with pytest - -env: - BABYLON_SERVICE: ${{ vars.BABYLON_SERVICE }} - BABYLON_TOKEN: ${{ secrets.BABYLON_TOKEN }} - BABYLON_ORG_NAME: ${{ vars.BABYLON_ORG_NAME }} - -on: - push: - branches: - - "main" - pull_request: - branches: - - "main" - - "**-dev" - - "feat**" -jobs: - flake8-lint: - runs-on: ubuntu-latest - environment: test - steps: - - uses: actions/checkout@v3 - name: Checkout repository - with: - fetch-depth: 0 - - uses: actions/setup-python@v3 - with: - python-version: "3.11" - - - name: install babylon and requirements - run: | - pip install -e . - - - name: run pytest organizations service - run: | - babylon namespace use -c test -p sphinx -s testid - pytest . Babylon/test/api/organizations/test_organizations_service.py \ No newline at end of file