Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable github actions for PRs on all branches #227

Merged
merged 4 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 0 additions & 37 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ on:
- setup.py
- .github/workflows/build.yml
pull_request:
branches:
- main
- dev
paths:
- bin/**
- src/**
Expand Down Expand Up @@ -89,37 +86,3 @@ jobs:
install-nplinker-deps --run-on-github
- name: Run unit tests
run: pytest -v

sonarcloud:
name: SonarCloud
needs: smoke_test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Python info
shell: bash -l {0}
run: |
which python3
python3 --version
- name: Upgrade pip and setuptools
run: |
python3 -m pip install --upgrade pip setuptools wheel
- name: Install nplinker and its dependencies
run: |
python3 -m pip install .[dev]
install-nplinker-deps --run-on-github
- name: Check style against standards using ruff
run: ruff .
- name: Run unit tests with coverage
run: pytest --cov --cov-report term --cov-report xml --junitxml=xunit-result.xml tests/
- name: Correct coverage paths
run: sed -i "s+$PWD/++g" coverage.xml
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{secrets.SONAR_TOKEN }}
40 changes: 0 additions & 40 deletions .github/workflows/documentation.yml

This file was deleted.

63 changes: 63 additions & 0 deletions .github/workflows/sonar-cloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Check format and coverage, then upload to SonarCloud

on:
push:
branches:
- main
- dev
paths:
- bin/**
- src/**
- tests/**
- setup.py
- .github/workflows/build.yml
pull_request:
branches:
- main
- dev
paths:
- bin/**
- src/**
- tests/**
- setup.py
- .github/workflows/build.yml
types:
- opened
- reopened
- synchronize
- ready_for_review

jobs:

sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Python info
shell: bash -l {0}
run: |
which python3
python3 --version
- name: Upgrade pip and setuptools
run: |
python3 -m pip install --upgrade pip setuptools wheel
- name: Install nplinker and its dependencies
run: |
python3 -m pip install .[dev]
install-nplinker-deps --run-on-github
- name: Check style against standards using ruff
run: ruff check .
- name: Run unit tests with coverage
run: pytest --cov --cov-report term --cov-report xml --junitxml=xunit-result.xml tests/unit
- name: Correct coverage paths
gcroci2 marked this conversation as resolved.
Show resolved Hide resolved
run: sed -i "s+$PWD/++g" coverage.xml
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{secrets.SONAR_TOKEN }}
3 changes: 0 additions & 3 deletions .github/workflows/typing-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ on:
- src/**
- tests/**
pull_request:
branches:
- main
- dev
paths:
- src/**
- tests/**
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ ignore_missing_imports = true
[tool.ruff]
target-version = "py310"
line-length = 100

[tool.ruff.lint]
select = [
"D", # pydocstyle
"E", # pycodestyle (error)
Expand Down Expand Up @@ -100,7 +102,7 @@ fixable = ["A", "B", "C", "D", "E", "F", "I"]
ignore-init-module-imports = true


[tool.ruff.isort]
[tool.ruff.lint.isort]
known-first-party = ["nplinker"]
force-single-line = true
lines-after-imports = 2
Expand Down
Loading