Skip to content

Commit

Permalink
Merge branch 'master' into unipept-biotools
Browse files Browse the repository at this point in the history
  • Loading branch information
bgruening authored Mar 12, 2024
2 parents cfb01ad + 55c6ded commit c80d8bc
Show file tree
Hide file tree
Showing 6 changed files with 160 additions and 123 deletions.
36 changes: 36 additions & 0 deletions .github/styler.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env Rscript

library("argparse")
library("styler")

parser <- ArgumentParser(description = "Call styler")
parser$add_argument("dir",
metavar = "DIR", type = "character",
help = "File to parse"
)
parser$add_argument("--dry",
choices = c("off", "on"), default = "on"
)
args <- parser$parse_args()

file_info <- file.info(args$dir)
is_directory <- file_info$isdir

if (is_directory) {
captured_output <- capture.output({
result <- style_dir(args$dir, indent_by = 4, dry = args$dry, recursive = TRUE)
})
} else {
captured_output <- capture.output({
result <- style_file(args$dir, indent_by = 4, dry = args$dry)
})
}

n <- nrow(subset(result, changed == TRUE))
if (n > 0) {
if (args$dry == "off") {
print(paste("Changed", n, "files"))
} else {
stop(paste("Linting failed for", n, "files"))
}
}
86 changes: 54 additions & 32 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
types: [run-all-tool-tests-command]
env:
GALAXY_FORK: galaxyproject
GALAXY_BRANCH: release_23.1
GALAXY_BRANCH: release_23.2
MAX_CHUNKS: 40
jobs:
setup:
Expand All @@ -23,11 +23,11 @@ jobs:
chunk-list: ${{ steps.discover.outputs.chunk-list }}
strategy:
matrix:
python-version: ['3.7']
python-version: ['3.11']
steps:
- name: Add reaction
if: ${{ github.event.client_payload.slash_command.command == 'run-all-tool-tests' }}
uses: peter-evans/create-or-update-comment@v2
uses: peter-evans/create-or-update-comment@v4
with:
token: ${{ secrets.PAT }}
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
Expand All @@ -43,11 +43,11 @@ jobs:
- name: Determine latest commit in the Galaxy repo
id: get-galaxy-sha
run: echo "galaxy-head-sha=$(git ls-remote https://github.com/${{ steps.get-fork-branch.outputs.fork }}/galaxy refs/heads/${{ steps.get-fork-branch.outputs.branch }} | cut -f1)" >> $GITHUB_OUTPUT
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache .cache/pip
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-pip
with:
path: ~/.cache/pip
Expand All @@ -56,7 +56,7 @@ jobs:
# are not available as wheels, pip will build a wheel for them, which can be cached.
- name: Install wheel
run: pip install wheel
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Fake a Planemo run to update cache and determine commit range, repositories, and chunks
Expand All @@ -74,6 +74,42 @@ jobs:
run: |
echo 'Using ${{ steps.discover.outputs.chunk-count }} chunks (${{ steps.discover.outputs.chunk-list }})'
lint:
name: Check for missing containers
needs: setup
if: ${{ needs.setup.outputs.repository-list != '' || needs.setup.outputs.tool-list != '' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.11']
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache .cache/pip
uses: actions/cache@v4
id: cache-pip
with:
path: ~/.cache/pip
key: pip_cache_py_${{ matrix.python-version }}_gxy_${{ needs.setup.outputs.galaxy-head-sha }}
- name: Planemo lint
uses: galaxyproject/planemo-ci-action@v1
id: lint
with:
mode: lint
repository-list: ${{ needs.setup.outputs.repository-list }}
tool-list: ${{ needs.setup.outputs.tool-list }}
additional-planemo-options: --biocontainers -s tests,output,inputs,help,general,command,citations,tool_xsd,xml_order,tool_urls,shed_metadata
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: 'Tool linting output'
path: lint_report.txt

test:
name: Test tools
# This job runs on Linux
Expand All @@ -84,7 +120,7 @@ jobs:
fail-fast: false
matrix:
chunk: ${{ fromJson(needs.setup.outputs.chunk-list) }}
python-version: ['3.7']
python-version: ['3.11']
services:
postgres:
image: postgres:11
Expand All @@ -97,37 +133,23 @@ jobs:
steps:
# checkout the repository
# and use it as the current working directory
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache .cache/pip
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-pip
with:
path: ~/.cache/pip
key: pip_cache_py_${{ matrix.python-version }}_gxy_${{ needs.setup.outputs.galaxy-head-sha }}
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
uses: SimenB/github-actions-cpu-cores@v2
id: cpu-cores
- name: Clean dotnet folder for space
run: rm -Rf /usr/share/dotnet
# TODO this is only temporary and only for OpenMS
- name: create test data
run: |
echo '${{ needs.setup.outputs.repository-list }}' > repository_list.txt
while read repo
do
if [ -x $repo/test-data.sh ]; then
cd $repo
./test-data.sh
fi
done < repository_list.txt
# TODO without this planemo task aborts with `System.IO.IOException: No space left on device`
# sudo swapoff -a
# sudo rm -f /swapfile
- name: Planemo test
uses: galaxyproject/planemo-ci-action@v1
id: test
Expand All @@ -141,7 +163,7 @@ jobs:
galaxy-slots: ${{ steps.cpu-cores.outputs.count }}
# Limit each test to 15 minutes
test_timeout: 900
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: 'Tool test output ${{ matrix.chunk }}'
path: upload
Expand All @@ -156,18 +178,18 @@ jobs:
needs: [setup, test]
strategy:
matrix:
python-version: ['3.7']
python-version: ['3.11']
# This job runs on Linux
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
path: artifacts
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache .cache/pip
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-pip
with:
path: ~/.cache/pip
Expand All @@ -178,7 +200,7 @@ jobs:
with:
mode: combine
html-report: true
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: 'All tool test results'
path: upload
Expand All @@ -189,7 +211,7 @@ jobs:

- name: Create comment
if: ${{ github.event.client_payload.slash_command.command == 'run-all-tool-tests' }}
uses: peter-evans/create-or-update-comment@v2
uses: peter-evans/create-or-update-comment@v4
with:
token: ${{ secrets.PAT }}
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
Expand Down
Loading

0 comments on commit c80d8bc

Please sign in to comment.