From e1cc96e1554f0a5291768774aa7f569164466487 Mon Sep 17 00:00:00 2001 From: Peter Tsrunchev Date: Wed, 15 Jan 2025 16:46:25 +0000 Subject: [PATCH] misc[gha]: split jobs --- .github/workflows/check-publish.yaml | 44 +++++++--------------------- .github/workflows/qa.yaml | 38 ++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 34 deletions(-) create mode 100644 .github/workflows/qa.yaml diff --git a/.github/workflows/check-publish.yaml b/.github/workflows/check-publish.yaml index 5b8d125..ddc469d 100644 --- a/.github/workflows/check-publish.yaml +++ b/.github/workflows/check-publish.yaml @@ -1,52 +1,28 @@ name: Check and publish on: - push: branches: - - '**' + - 'develop' + - 'master' + - 'main' tags: - '**' - # pull_request: ~ + pull_request: + branches: + - 'master' + - 'main' workflow_dispatch: ~ jobs: - - quality: - name: Code QA - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - run: pip install black flake8 isort - - run: black --version - - run: isort --check . - - run: black --check . - - run: flake8 . - unit-tests: - name: Unit tests - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' - cache: 'pip' - - name: Install dependencies - run: pip install -r requirements.txt - - name: Run tests - run: pytest tests/unit docs: - if: | - (github.event_name == 'push' && contains(github.ref, 'refs/tags/')) || - github.ref == 'refs/heads/master' name: Build Readthedocs runs-on: ubuntu-latest steps: - name: Start polytope-docs build - uses: actions/github-script@v4 + uses: actions/github-script@v7 with: github-token: ${{ secrets.GH_REPO_READ_TOKEN }} script: |- @@ -64,9 +40,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Start polytope-docs build - uses: actions/github-script@v4 + uses: actions/github-script@v7 with: - github-token: ${{ secrets.ECMWF_REPO_ACCESS }} + github-token: ${{ secrets.GH_REPO_READ_TOKEN }} script: |- await github.actions.createWorkflowDispatch({ owner: 'ecmwf-projects', diff --git a/.github/workflows/qa.yaml b/.github/workflows/qa.yaml new file mode 100644 index 0000000..9ccf1c5 --- /dev/null +++ b/.github/workflows/qa.yaml @@ -0,0 +1,38 @@ +name: Code quality and unit tests + +on: + push: + branches: + - '**' + tags: + - '**' + + # pull_request: ~ + + workflow_dispatch: ~ + +jobs: + quality: + name: Code QA + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: pip install black flake8 isort + - run: black --version + - run: isort --check . + - run: black --check . + - run: flake8 . + unit-tests: + name: Unit tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + cache: 'pip' + - name: Install dependencies + run: pip install -r requirements.txt + - name: Run tests + run: pytest tests/unit \ No newline at end of file