-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GA: Split out package-check job from coverage jobs
- Loading branch information
1 parent
642a35e
commit 73d2218
Showing
4 changed files
with
136 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
on: | ||
push: | ||
paths: | ||
- 'python/**/*' | ||
- .github/workflows/check-python.yml | ||
pull_request: | ||
paths: | ||
- 'python/**/*' | ||
- .github/workflows/check-python.yml | ||
|
||
name: "Python checks" | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
check: | ||
if: "! contains(github.event.head_commit.message, '[ci skip]')" | ||
|
||
timeout-minutes: 5 | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: 3.10 | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
- name: Install port4me | ||
run: | | ||
cd python/ | ||
pip install . | ||
- name: Session information | ||
run: | | ||
python -c "import os; print('EUID='+str(os.geteuid()))" | ||
python --version | ||
python -m port4me --version | ||
- name: Generate coverage report | ||
run: | | ||
pip install pytest-cov | ||
cd python | ||
pytest --cov=port4me ## output summarize in GitHub logs | ||
pytest --cov=port4me --cov-report=xml:coverage.xml | ||
## AD HOC: Make reported paths relative to the root of repository | ||
sed -i 's/filename="/filename="python\/port4me\//g' coverage.xml | ||
- name: Upload Coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
env_vars: OS,PYTHON | ||
files: python/coverage.xml | ||
fail_ci_if_error: true | ||
flags: python | ||
name: codecov-umbrella-python | ||
verbose: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
on: | ||
push: | ||
paths: | ||
- 'r/**/*' | ||
- .github/workflows/check-r.yml | ||
pull_request: | ||
paths: | ||
- 'r/**/*' | ||
- .github/workflows/check-r.yml | ||
|
||
name: "R checks" | ||
|
||
jobs: | ||
check: | ||
if: "! contains(github.event.head_commit.message, '[ci skip]')" | ||
|
||
timeout-minutes: 10 | ||
|
||
runs-on: ubuntu-latest | ||
|
||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
R_KEEP_PKG_SOURCE: yes | ||
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | ||
## R CMD check | ||
_R_CHECK_CRAN_INCOMING_: false | ||
_R_CHECK_MATRIX_DATA_: true | ||
_R_CHECK_SUGGESTS_ONLY_: true | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: r-lib/actions/setup-pandoc@v2 | ||
|
||
- uses: r-lib/actions/setup-tinytex@v2 | ||
|
||
- name: Install system dependencies (Linux) | ||
if: runner.os == 'Linux' | ||
run: sudo apt-get install -y tidy | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
use-public-rspm: true | ||
|
||
- uses: r-lib/actions/setup-r-dependencies@v2 | ||
with: | ||
working-directory: r | ||
extra-packages: any::rcmdcheck any::covr any::jsonlite | ||
needs: check coverage | ||
|
||
- name: Install port4me | ||
run: | | ||
cd r/ | ||
Rscript -e "install.packages('.', repos = NULL, type = 'source')" | ||
- name: Session info | ||
run: | | ||
options(width = 100) | ||
capabilities() | ||
pkgs <- installed.packages()[, "Package"] | ||
sessioninfo::session_info(pkgs, include_base = TRUE) | ||
shell: Rscript {0} | ||
|
||
- name: Test coverage | ||
run: | | ||
setwd("r") | ||
## relative_path = ".." => reported files r/R/*.R, r/src/*.{c,h} | ||
coverage <- covr::package_coverage(relative_path = "..", quiet = FALSE) | ||
print(coverage) | ||
covr::codecov(coverage = coverage, flags = "r", quiet = FALSE) ## Upload to codecov | ||
shell: Rscript {0} |