Skip to content

Commit

Permalink
Merge branch 'release/0.7.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
HenrikBengtsson committed Jan 15, 2024
2 parents 2fdffa3 + c573760 commit 4f6ce09
Show file tree
Hide file tree
Showing 54 changed files with 2,701 additions and 542 deletions.
62 changes: 40 additions & 22 deletions .github/workflows/check-bash.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
on: [push, pull_request]
on:
push:
paths:
- 'bash/**/*'
- .github/workflows/check-bash.yml
pull_request:
paths:
- 'bash/**/*'
- .github/workflows/check-bash.yml

name: "Bash checks"

Expand All @@ -9,41 +17,51 @@ jobs:
check:
if: "! contains(github.event.head_commit.message, '[ci skip]')"

timeout-minutes: 10
timeout-minutes: 5

runs-on: ubuntu-latest
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }}

strategy:
fail-fast: false
matrix:
config:
# - {os: macOS-latest }
- {os: ubuntu-latest }
- {os: ubuntu-20.04 }

steps:
- name: Checkout git repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install dependencies
- name: ShellCheck
if: runner.os == 'Linux'
run: |
curl -L -O https://github.com/bats-core/bats-core/archive/refs/tags/v1.7.0.tar.gz && tar xf v1.7.0.tar.gz
curl -L -O https://github.com/bats-core/bats-support/archive/refs/tags/v0.3.0.tar.gz && tar xf v0.3.0.tar.gz
curl -L -O https://github.com/bats-core/bats-assert/archive/refs/tags/v2.0.0.tar.gz && tar xf v2.0.0.tar.gz
curl -L -O https://github.com/koalaman/shellcheck/releases/download/v0.9.0/shellcheck-v0.9.0.linux.x86_64.tar.xz
tar Jxf shellcheck-v0.9.0.linux.x86_64.tar.xz
mv shellcheck-v0.9.0/shellcheck .
- name: Session information
run: |
PATH="$PWD:$PATH" shellcheck --version
BATS_SUPPORT_HOME=bats-support-0.3.0 BATS_ASSERT_HOME=bats-assert-2.0.0 PATH="bats-core-1.7.0/bin:$PATH" bats --version
- name: ShellCheck
run: |
export PATH="$PWD:$PATH"
cd bash/
shellcheck --version
shellcheck incl/*.bash
shellcheck -x port4me
- name: Check with Bats
(cd tests; shellcheck -x *.bats)
- name: Check
run: |
echo "SHELL=${SHELL}"
bash --version
command -v bash
command -v kill || true
command -v timeout || true
curl -L -O https://github.com/bats-core/bats-core/archive/refs/tags/v1.10.0.tar.gz && tar xf v1.10.0.tar.gz
curl -L -O https://github.com/bats-core/bats-support/archive/refs/tags/v0.3.0.tar.gz && tar xf v0.3.0.tar.gz
curl -L -O https://github.com/bats-core/bats-assert/archive/refs/tags/v2.1.0.tar.gz && tar xf v2.1.0.tar.gz
export BATS_SUPPORT_HOME=$PWD/bats-support-0.3.0
export BATS_ASSERT_HOME=$PWD/bats-assert-2.0.0
export PATH=$PWD/bats-core-1.7.0/bin:$PATH
export BATS_ASSERT_HOME=$PWD/bats-assert-2.1.0
export PATH=$PWD/bats-core-1.10.0/bin:$PATH
export PATH=$PWD/bash:$PATH
bats --version
cd bash/tests/
bats *.bats
cd bash/
make check-cli
78 changes: 50 additions & 28 deletions .github/workflows/check-python.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
on: [push, pull_request]
on:
push:
paths:
- 'python/**/*'
- .github/workflows/check-python.yml
pull_request:
paths:
- 'python/**/*'
- .github/workflows/check-python.yml

name: "Python checks"

Expand All @@ -9,29 +17,36 @@ jobs:
check:
if: "! contains(github.event.head_commit.message, '[ci skip]')"

timeout-minutes: 10
timeout-minutes: 5

runs-on: ubuntu-latest
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (Python ${{ matrix.config.python }})

strategy:
fail-fast: false
matrix:
config:
- {os: ubuntu-latest, python: '3.7' }
- {os: ubuntu-latest, python: '3.8' }
- {os: ubuntu-latest, python: '3.9' }
- {os: ubuntu-latest, python: '3.10' }
- {os: ubuntu-latest, python: '3.11' }
- {os: ubuntu-latest, python: '3.12' }
- {os: macOS-latest, python: '3.11' }
- {os: windows-latest, python: '3.11' }

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python 3.10
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
python-version: ${{ matrix.config.python }}

- name: Install dependencies
run: |
curl -L -O https://github.com/bats-core/bats-core/archive/refs/tags/v1.7.0.tar.gz && tar xf v1.7.0.tar.gz
curl -L -O https://github.com/bats-core/bats-support/archive/refs/tags/v0.3.0.tar.gz && tar xf v0.3.0.tar.gz
curl -L -O https://github.com/bats-core/bats-assert/archive/refs/tags/v2.0.0.tar.gz && tar xf v2.0.0.tar.gz
curl -L -O https://github.com/koalaman/shellcheck/releases/download/v0.9.0/shellcheck-v0.9.0.linux.x86_64.tar.xz
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
tar Jxf shellcheck-v0.9.0.linux.x86_64.tar.xz
mv shellcheck-v0.9.0/shellcheck .
- name: Install port4me
run: |
Expand All @@ -40,28 +55,35 @@ jobs:
- name: Session information
run: |
PATH="$PWD:$PATH" shellcheck --version
python -c "import os; print('EUID='+str(os.geteuid()))"
python --version
python -m port4me --version
- name: Test with pytest
run: |
pip install pytest
pytest
- name: Check CLI
if: runner.os != 'Windows'
run: |
curl -L -O https://github.com/bats-core/bats-core/archive/refs/tags/v1.10.0.tar.gz && tar xf v1.10.0.tar.gz
curl -L -O https://github.com/bats-core/bats-support/archive/refs/tags/v0.3.0.tar.gz && tar xf v0.3.0.tar.gz
curl -L -O https://github.com/bats-core/bats-assert/archive/refs/tags/v2.1.0.tar.gz && tar xf v2.1.0.tar.gz
export BATS_SUPPORT_HOME=$PWD/bats-support-0.3.0
export BATS_ASSERT_HOME=$PWD/bats-assert-2.1.0
export PATH=$PWD/bats-core-1.10.0/bin:$PATH
bash --version
bats --version
cd python/
make check-cli
- name: Lint with flake8
run: |
pip install flake8
cd python/
flake8 --version
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
- name: Check with Bats
run: |
export BATS_SUPPORT_HOME=$PWD/bats-support-0.3.0
export BATS_ASSERT_HOME=$PWD/bats-assert-2.0.0
export PATH=$PWD/bats-core-1.7.0/bin:$PATH
bats --version
cd python/tests/
bats *.bats
Original file line number Diff line number Diff line change
@@ -1,29 +1,39 @@
on: [push, pull_request]
on:
push:
paths:
- 'r/**/*'
- .github/workflows/check-r.yml
pull_request:
paths:
- 'r/**/*'
- .github/workflows/check-r.yml

name: "R checks"

jobs:
R-CMD-check:
check:
if: "! contains(github.event.head_commit.message, '[ci skip]')"

timeout-minutes: 30
timeout-minutes: 10

runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})
name: ${{ matrix.config.os }} (R ${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: windows-latest, r: 'devel' }
- {os: windows-latest, r: 'release' }
- {os: macOS-latest, r: 'devel' }
- {os: windows-latest, r: 'oldrel' }
# - {os: macOS-latest, r: 'devel' }
- {os: macOS-latest, r: 'release' }
- {os: ubuntu-20.04, r: 'devel' }
- {os: ubuntu-20.04, r: 'release' }
- {os: ubuntu-20.04, r: 'oldrel' }
- {os: ubuntu-20.04, r: '4.0' }
# - {os: macOS-latest, r: 'oldrel' }
- {os: ubuntu-latest, r: 'devel' }
- {os: ubuntu-latest, r: 'release' }
- {os: ubuntu-latest, r: 'oldrel' }
- {os: ubuntu-latest, r: '3.6' }
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
Expand All @@ -36,7 +46,7 @@ jobs:
_R_CHECK_SUGGESTS_ONLY_: true

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

Expand All @@ -49,12 +59,17 @@ jobs:
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
working-directory: r
extra-packages: any::rcmdcheck
needs: check
extra-packages: any::rcmdcheck any::jsonlite

- name: Install port4me
run: |
cd r/
Rscript -e "install.packages('.', repos = NULL, type = 'source')"
- name: Session info
run: |
Expand All @@ -64,7 +79,7 @@ jobs:
sessioninfo::session_info(pkgs, include_base = TRUE)
shell: Rscript {0}

- name: Check (!Windows)
- name: Check
if: runner.os != 'Windows'
run: |
rcmdcheck::rcmdcheck(
Expand All @@ -75,7 +90,7 @@ jobs:
)
shell: Rscript {0}

- name: Check (Windows)
- name: Check (MS Windows)
if: runner.os == 'Windows'
run: |
rcmdcheck::rcmdcheck(
Expand All @@ -86,6 +101,21 @@ jobs:
)
shell: Rscript {0}

- name: Check CLI
if: runner.os != 'Windows'
run: |
curl -L -O https://github.com/bats-core/bats-core/archive/refs/tags/v1.10.0.tar.gz && tar xf v1.10.0.tar.gz
curl -L -O https://github.com/bats-core/bats-support/archive/refs/tags/v0.3.0.tar.gz && tar xf v0.3.0.tar.gz
curl -L -O https://github.com/bats-core/bats-assert/archive/refs/tags/v2.1.0.tar.gz && tar xf v2.1.0.tar.gz
export BATS_SUPPORT_HOME=$PWD/bats-support-0.3.0
export BATS_ASSERT_HOME=$PWD/bats-assert-2.1.0
export PATH=$PWD/bats-core-1.10.0/bin:$PATH
bash --version
bats --version
cd r/
make check-cli
- name: Upload check results
if: failure()
uses: actions/upload-artifact@v3
Expand Down
64 changes: 64 additions & 0 deletions .github/workflows/coverage-python.yml
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 test coverage"

permissions:
contents: read

jobs:
coverage:
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
Loading

0 comments on commit 4f6ce09

Please sign in to comment.