Skip to content

Commit

Permalink
Merge pull request #195 from AlexVCaron/test/data
Browse files Browse the repository at this point in the history
[IMPROV] Test data introspection extension for VSCode
  • Loading branch information
AlexVCaron authored Sep 5, 2024
2 parents c42e548 + 4c6be2b commit 8e5a83d
Show file tree
Hide file tree
Showing 50 changed files with 6,856 additions and 529 deletions.
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

0 comments on commit 8e5a83d

Please sign in to comment.