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

[IMPROV] Test data introspection extension for VSCode #195

Merged
merged 24 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f1f2076
move test data to json file
AlexVCaron Aug 20, 2024
2da0b36
setup container for vscode extension dev
AlexVCaron Aug 23, 2024
4cffe18
move extension package to its own directory
AlexVCaron Aug 23, 2024
2b5fce4
test data treeview extension first try
AlexVCaron Aug 23, 2024
65084fe
test data treeview extension first try
AlexVCaron Aug 23, 2024
33fb0eb
remove dist
AlexVCaron Aug 23, 2024
7648a2f
update extension package and create extension publishing workflow
AlexVCaron Aug 30, 2024
606df31
trigger test suite
AlexVCaron Aug 30, 2024
fa6d41e
run prettier
AlexVCaron Aug 30, 2024
fc323e7
use cache correctly and streamline versions through workflow reuse
AlexVCaron Sep 3, 2024
b38e51b
fix caching
AlexVCaron Sep 4, 2024
3cc08c0
fix
AlexVCaron Sep 4, 2024
61e2c22
add package as well
AlexVCaron Sep 4, 2024
c2f852f
fix + run prettier and editorconfig-checker
AlexVCaron Sep 4, 2024
a536426
add reports to nf-test outputs
AlexVCaron Sep 4, 2024
22fdf8f
add report upload and merging
AlexVCaron Sep 4, 2024
6cc8326
editorconfig fix to trigger tests
AlexVCaron Sep 4, 2024
59275f0
fix linting cache
AlexVCaron Sep 4, 2024
03fcbaa
call linting through poetry
AlexVCaron Sep 4, 2024
6469917
fix
AlexVCaron Sep 4, 2024
aa7c870
move publishing to main workflow entry, since it runs only on main. f…
AlexVCaron Sep 4, 2024
faccae7
run fastseg on lightweight test data
AlexVCaron Sep 4, 2024
0259258
same for anatomical_segmentation workflow
AlexVCaron Sep 5, 2024
4c6be2b
add treeview to package
AlexVCaron Sep 5, 2024
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
12 changes: 10 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
FROM scilus/scilus:2.0.2

ARG NFTEST_VERSION
ARG POETRY_VERSION

ENV NODE_MAJOR=18
ENV NFTEST_VERSION=${NFTEST_VERSION:-0.9.0-rc1}
ENV POETRY_VERSION=${POETRY_VERSION:-1.8.*}

RUN apt update && apt install -y \
curl \
Expand All @@ -14,7 +16,13 @@ RUN apt update && apt install -y \

RUN python3 -m pip install pipx && \
python3 -m pipx ensurepath && \
pipx install poetry
pipx install poetry==${POETRY_VERSION}

RUN curl -fsSL https://deb.nodesource.com/setup_${NODE_MAJOR}.x | bash - &&\
apt-get install -y nodejs
apt-get install -y nodejs && \
groupadd --gid 501 yeoman && \
useradd --uid 501 --gid yeoman --shell /bin/bash --create-home yeoman && \
echo "yeoman ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers

RUN mkdir /generated && chown yeoman:yeoman /generated
WORKDIR /generated
6 changes: 5 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
"build": {
"dockerfile": "Dockerfile",
"args": {
"NFTEST_VERSION": "0.9.0-rc1"
"NFTEST_VERSION": "0.9.0-rc1",
"POETRY_VERSION": "1.8.*"
}
},
"forwardPorts": [3000],
"onCreateCommand": "bash .devcontainer/onCreateCommand.sh",
"updateContentCommand": "bash .devcontainer/updateContentCommand.sh",
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
"containerEnv": {
"WORKSPACE": "${containerWorkspaceFolder}"
},
"features": {
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/git-lfs:1": {},
Expand Down
9 changes: 9 additions & 0 deletions .devcontainer/onCreateCommand.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

# Setup for NF-CORE

npm install -g --save-dev --save-exact prettier
npm install -g editorconfig
npm install -g --save-dev editorconfig-checker
Expand All @@ -12,3 +14,10 @@ mkdir -p /nf-test/bin
cd /nf-test/bin/
curl -fsSL https://code.askimed.com/install/nf-test | bash -s ${NFTEST_VERSION}
echo "PATH=$PATH:/nf-test/bin" >> ~/.bashrc


# Setup for VSCODE Extensions Development

npm install -g typescript
npm install -g tslint
npm install -g yo generator-code
57 changes: 46 additions & 11 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
name: nf-scil checks
on:
workflow_call:
inputs:
nextflow_version:
description: "Nextflow version to use"
required: false
type: string
default: "24.04.4"
nf_core_version:
description: "nf-core version to use"
required: false
type: string
default: "2.14.*"
nf_test_version:
description: "nf-test version to use"
required: false
type: string
default: "0.9.0-rc1"

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -11,6 +27,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
cache: 'pip'
- uses: pre-commit/[email protected]
# FIXME Flip this off once we get to less than a couple hundred. Adding
# this so it will only run against changed files. It'll make it much
Expand All @@ -21,34 +39,32 @@ jobs:
prettier:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Install NodeJS
uses: actions/setup-node@v4
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: 'npm'

- name: Install Prettier
run: npm install -g [email protected]
run: npm ci

- name: Run Prettier --check
run: prettier --check .
run: npx prettier --check .

editorconfig:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: "20"
cache: 'npm'

- name: Install editorconfig-checker
run: npm install -g editorconfig-checker
run: npm ci

- name: Run ECLint check
run: editorconfig-checker -exclude README.md $(git ls-files | grep -v test)
run: npx editorconfig-checker -exclude README.md $(git ls-files | grep -v test)

nf-test-changes:
name: compute - changes
Expand Down Expand Up @@ -95,6 +111,7 @@ jobs:
with:
type: "module"
component: ${{ matrix.module }}
nextflow_version: ${{ inputs.nextflow_version }}
secrets: inherit

lint-subworkflows:
Expand All @@ -111,6 +128,7 @@ jobs:
with:
type: "subworkflow"
component: ${{ matrix.subworkflow }}
nextflow_version: ${{ inputs.nextflow_version }}
secrets: inherit

nf-test:
Expand All @@ -133,12 +151,29 @@ jobs:
profile: ${{ matrix.profile }}
paths: ${{ matrix.path }}
runner: ${{ matrix.runner }}
nextflow_version: ${{ inputs.nextflow_version }}
nf_test_version: ${{ inputs.nf_test_version }}
secrets: inherit

upload-reports:
name: upload reports
needs: [nf-test-changes, nf-test]
if: ${{ ( needs.nf-test-changes.outputs.paths != '[]' ) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/upload-artifact/merge@v4
with:
name: nf-test-reports
pattern: reports-*
delete-merged: true
retention-days: 10
compression-level: 9

confirm-pass:
name: status
runs-on: ubuntu-latest
needs: [prettier, editorconfig, nf-test-changes, lint-modules, lint-subworkflows, nf-test]
needs: [prettier, editorconfig, nf-test-changes, lint-modules, lint-subworkflows, nf-test, upload-reports]
if: ${{ !cancelled() }}
steps:
- name: All tests ok
Expand Down
70 changes: 0 additions & 70 deletions .github/workflows/code_linting.yml

This file was deleted.

44 changes: 24 additions & 20 deletions .github/workflows/lint_module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ on:
options:
- module
- subworkflow
nextflow_version:
description: "Nextflow version to use"
required: false
type: string
default: "24.04.4"
workflow_call:
inputs:
component:
Expand All @@ -24,6 +29,11 @@ on:
description: "Type of component"
required: true
type: string
nextflow_version:
description: "Nextflow version to use"
required: false
type: string
default: "24.04.4"

run-name: Lint ${{ inputs.component }}
jobs:
Expand All @@ -33,36 +43,30 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
- uses: abatilo/actions-poetry@v2
with:
python-version: "3.11"

- uses: actions/cache@v4
poetry-version: "1.8.*"
- uses: actions/setup-python@v5
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip
${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}

- name: Install pip
run: python -m pip install --upgrade pip

python-version: "3.11"
cache: 'poetry'
- uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"

- name: Setup Nextflow
uses: nf-core/setup-nextflow@v2
- uses: nf-core/setup-nextflow@v2
with:
version: ${{ inputs.nextflow_version }}

- name: Install nf-core tools
run: |
python -m pip install --upgrade --force-reinstall nf-core==2.14.*
poetry install --no-root

- name: Lint ${{ inputs.type }} ${{ inputs.component }}
env:
GIT_CLONE_PROTECTION_ACTIVE: false
run: nf-core --verbose ${{ inputs.type }}s --git-remote https://github.com/scilus/nf-scil.git lint ${{ inputs.component }}
run: |
poetry run nf-core --verbose ${{ inputs.type }}s \
--git-remote https://github.com/${{ github.repository }}.git \
--branch ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} \
lint ${{ inputs.component }}
Loading
Loading