Skip to content

Commit 4196e9b

Browse files
authored
Merge pull request #618 from bernt-matthias/24.0
bump workflows to 24.0 and sync with IUC
2 parents 72d538d + dd24318 commit 4196e9b

File tree

5 files changed

+231
-93
lines changed

5 files changed

+231
-93
lines changed

.github/styler.R

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env Rscript
2+
3+
library("argparse")
4+
library("styler")
5+
6+
parser <- ArgumentParser(description = "Call styler")
7+
parser$add_argument("dir",
8+
metavar = "DIR", type = "character",
9+
help = "File to parse"
10+
)
11+
parser$add_argument("--dry",
12+
choices = c("off", "on"), default = "on"
13+
)
14+
args <- parser$parse_args()
15+
16+
file_info <- file.info(args$dir)
17+
is_directory <- file_info$isdir
18+
19+
if (is_directory) {
20+
captured_output <- capture.output({
21+
result <- style_dir(args$dir, indent_by = 4, dry = args$dry, recursive = TRUE)
22+
})
23+
} else {
24+
captured_output <- capture.output({
25+
result <- style_file(args$dir, indent_by = 4, dry = args$dry)
26+
})
27+
}
28+
29+
n <- nrow(subset(result, changed == TRUE))
30+
if (n > 0) {
31+
if (args$dry == "off") {
32+
print(paste("Changed", n, "files"))
33+
} else {
34+
stop(paste("Linting failed for", n, "files"))
35+
}
36+
}

.github/workflows/ci.yaml

+65-21
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
types: [run-all-tool-tests-command]
88
env:
99
GALAXY_FORK: galaxyproject
10-
GALAXY_BRANCH: release_23.2
10+
GALAXY_BRANCH: release_24.0
1111
MAX_CHUNKS: 40
1212
jobs:
1313
setup:
@@ -23,11 +23,11 @@ jobs:
2323
chunk-list: ${{ steps.discover.outputs.chunk-list }}
2424
strategy:
2525
matrix:
26-
python-version: ['3.7']
26+
python-version: ['3.11']
2727
steps:
2828
- name: Add reaction
2929
if: ${{ github.event.client_payload.slash_command.command == 'run-all-tool-tests' }}
30-
uses: peter-evans/create-or-update-comment@v1
30+
uses: peter-evans/create-or-update-comment@v4
3131
with:
3232
token: ${{ secrets.PAT }}
3333
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}
@@ -37,17 +37,17 @@ jobs:
3737
id: get-fork-branch
3838
run: |
3939
TMP="${{ github.event.client_payload.slash_command.args.named.fork }}"
40-
echo "::set-output name=fork::${TMP:-$GALAXY_FORK}"
40+
echo "fork=${TMP:-$GALAXY_FORK}" >> $GITHUB_OUTPUT
4141
TMP="${{ github.event.client_payload.slash_command.args.named.branch }}"
42-
echo "::set-output name=branch::${TMP:-$GALAXY_BRANCH}"
42+
echo "branch=${TMP:-$GALAXY_BRANCH}" >> $GITHUB_OUTPUT
4343
- name: Determine latest commit in the Galaxy repo
4444
id: get-galaxy-sha
45-
run: echo "::set-output name=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)"
46-
- uses: actions/setup-python@v1
45+
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
46+
- uses: actions/setup-python@v5
4747
with:
4848
python-version: ${{ matrix.python-version }}
4949
- name: Cache .cache/pip
50-
uses: actions/cache@v2
50+
uses: actions/cache@v4
5151
id: cache-pip
5252
with:
5353
path: ~/.cache/pip
@@ -56,7 +56,7 @@ jobs:
5656
# are not available as wheels, pip will build a wheel for them, which can be cached.
5757
- name: Install wheel
5858
run: pip install wheel
59-
- uses: actions/checkout@v2
59+
- uses: actions/checkout@v4
6060
with:
6161
fetch-depth: 1
6262
- name: Fake a Planemo run to update cache and determine commit range, repositories, and chunks
@@ -74,6 +74,42 @@ jobs:
7474
run: |
7575
echo 'Using ${{ steps.discover.outputs.chunk-count }} chunks (${{ steps.discover.outputs.chunk-list }})'
7676
77+
lint:
78+
name: Check for missing containers
79+
needs: setup
80+
if: ${{ needs.setup.outputs.repository-list != '' || needs.setup.outputs.tool-list != '' }}
81+
runs-on: ubuntu-latest
82+
strategy:
83+
fail-fast: false
84+
matrix:
85+
python-version: ['3.11']
86+
steps:
87+
- uses: actions/checkout@v4
88+
with:
89+
fetch-depth: 1
90+
- uses: actions/setup-python@v5
91+
with:
92+
python-version: ${{ matrix.python-version }}
93+
- name: Cache .cache/pip
94+
uses: actions/cache@v4
95+
id: cache-pip
96+
with:
97+
path: ~/.cache/pip
98+
key: pip_cache_py_${{ matrix.python-version }}_gxy_${{ needs.setup.outputs.galaxy-head-sha }}
99+
- name: Planemo lint
100+
uses: galaxyproject/planemo-ci-action@v1
101+
id: lint
102+
with:
103+
mode: lint
104+
repository-list: ${{ needs.setup.outputs.repository-list }}
105+
tool-list: ${{ needs.setup.outputs.tool-list }}
106+
additional-planemo-options: --biocontainers -s tests,output,inputs,help,general,command,citations,tool_xsd,xml_order,tool_urls,shed_metadata
107+
- uses: actions/upload-artifact@v4
108+
if: ${{ failure() }}
109+
with:
110+
name: 'Tool linting output'
111+
path: lint_report.txt
112+
77113
test:
78114
name: Test tools
79115
# This job runs on Linux
@@ -84,7 +120,7 @@ jobs:
84120
fail-fast: false
85121
matrix:
86122
chunk: ${{ fromJson(needs.setup.outputs.chunk-list) }}
87-
python-version: ['3.7']
123+
python-version: ['3.11']
88124
services:
89125
postgres:
90126
image: postgres:11
@@ -97,18 +133,23 @@ jobs:
97133
steps:
98134
# checkout the repository
99135
# and use it as the current working directory
100-
- uses: actions/checkout@v2
136+
- uses: actions/checkout@v4
101137
with:
102138
fetch-depth: 1
103-
- uses: actions/setup-python@v1
139+
- uses: actions/setup-python@v5
104140
with:
105141
python-version: ${{ matrix.python-version }}
106142
- name: Cache .cache/pip
107-
uses: actions/cache@v2
143+
uses: actions/cache@v4
108144
id: cache-pip
109145
with:
110146
path: ~/.cache/pip
111147
key: pip_cache_py_${{ matrix.python-version }}_gxy_${{ needs.setup.outputs.galaxy-head-sha }}
148+
- name: Get number of CPU cores
149+
uses: SimenB/github-actions-cpu-cores@v2
150+
id: cpu-cores
151+
- name: Clean dotnet folder for space
152+
run: rm -Rf /usr/share/dotnet
112153
- name: Planemo test
113154
uses: galaxyproject/planemo-ci-action@v1
114155
id: test
@@ -119,7 +160,10 @@ jobs:
119160
galaxy-branch: ${{ needs.setup.outputs.branch }}
120161
chunk: ${{ matrix.chunk }}
121162
chunk-count: ${{ needs.setup.outputs.chunk-count }}
122-
- uses: actions/upload-artifact@v2
163+
galaxy-slots: ${{ steps.cpu-cores.outputs.count }}
164+
# Limit each test to 15 minutes
165+
test_timeout: 900
166+
- uses: actions/upload-artifact@v4
123167
with:
124168
name: 'Tool test output ${{ matrix.chunk }}'
125169
path: upload
@@ -134,18 +178,18 @@ jobs:
134178
needs: [setup, test]
135179
strategy:
136180
matrix:
137-
python-version: ['3.7']
181+
python-version: ['3.11']
138182
# This job runs on Linux
139183
runs-on: ubuntu-latest
140184
steps:
141-
- uses: actions/download-artifact@v2
185+
- uses: actions/download-artifact@v4
142186
with:
143187
path: artifacts
144-
- uses: actions/setup-python@v1
188+
- uses: actions/setup-python@v5
145189
with:
146190
python-version: ${{ matrix.python-version }}
147191
- name: Cache .cache/pip
148-
uses: actions/cache@v2
192+
uses: actions/cache@v4
149193
id: cache-pip
150194
with:
151195
path: ~/.cache/pip
@@ -156,18 +200,18 @@ jobs:
156200
with:
157201
mode: combine
158202
html-report: true
159-
- uses: actions/upload-artifact@v2
203+
- uses: actions/upload-artifact@v4
160204
with:
161205
name: 'All tool test results'
162206
path: upload
163207
- name: Create URL to the run output
164208
if: ${{ github.event.client_payload.slash_command.command == 'run-all-tool-tests' }}
165209
id: vars
166-
run: echo "::set-output name=run-url::https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
210+
run: echo "run-url=https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> $GITHUB_OUTPUT
167211

168212
- name: Create comment
169213
if: ${{ github.event.client_payload.slash_command.command == 'run-all-tool-tests' }}
170-
uses: peter-evans/create-or-update-comment@v1
214+
uses: peter-evans/create-or-update-comment@v4
171215
with:
172216
token: ${{ secrets.PAT }}
173217
repository: ${{ github.event.client_payload.github.payload.repository.full_name }}

0 commit comments

Comments
 (0)