real fix #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: nf-scil checks | |
on: | |
push: | |
branches: | |
- main | |
pull_request_target: | |
branches: | |
- main | |
# Cancel if a newer run is started | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
env: | |
NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/.singularity | |
NXF_SINGULARITY_LIBRARYDIR: ${{ github.workspace }}/.singularity | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v3 | |
- 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 | |
# easier to fix these as they come up rather than everything at once. | |
with: | |
extra_args: "" | |
prettier: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Install NodeJS | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
- name: Install Prettier | |
run: npm install -g prettier | |
- name: Run Prettier --check | |
run: prettier --check . | |
editorconfig: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
- name: Install editorconfig-checker | |
run: npm install -g editorconfig-checker | |
- name: Run ECLint check | |
run: editorconfig-checker -exclude README.md $(git ls-files | grep -v test) | |
failing-modules: | |
name: failing-modules | |
runs-on: ubuntu-latest | |
outputs: | |
# Expose matched filters as job 'modules' output variable | |
modules: ${{ steps.filter.outputs.changes }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get branch names. | |
id: branch-names | |
uses: tj-actions/branch-names@v8 | |
- uses: SamhammerAG/last-successful-build-action@v5 | |
id: successful-ref | |
with: | |
branch: ${{ steps.branch-names.outputs.current_branch }} | |
token: ${{ github.token }} | |
workflow: "Modules Tests" | |
# TODO: change back to using dorny/paths-filter when https://github.com/dorny/paths-filter/pull/133 is implemented | |
- uses: mirpedrol/paths-filter@main | |
id: filter | |
with: | |
filters: "tests/config/pytest_modules.yml" | |
token: "" | |
base: ${{ steps.successful-ref.outputs.commit_hash }} | |
lint-modules: | |
name: lint-modules | |
needs: [failing-modules] | |
if: needs.failing-modules.outputs.modules != '[]' | |
strategy: | |
fail-fast: false | |
matrix: | |
module: ["${{ fromJson(needs.failing-modules.outputs.modules) }}"] | |
uses: ./.github/workflows/lint_module.yml | |
with: | |
module: ${{ matrix.module }} | |
secrets: inherit | |
test-modules: | |
name: test-modules | |
needs: [failing-modules] | |
if: needs.failing-modules.outputs.modules != '[]' | |
strategy: | |
fail-fast: false | |
matrix: | |
module: ["${{ fromJson(needs.failing-modules.outputs.modules) }}"] | |
profile: ["docker", "singularity"] | |
exclude: | |
- module: "nf-test" | |
uses: ./.github/workflows/test_module.yml | |
with: | |
module: ${{ matrix.module }} | |
profile: ${{ matrix.profile }} | |
secrets: inherit | |
confirm-pass: | |
runs-on: ubuntu-latest | |
needs: [prettier, editorconfig, failing-modules, lint-modules, test-modules] | |
if: ${{ !cancelled() }} | |
steps: | |
- name: All tests ok | |
if: ${{ success() || !contains(needs.*.result, 'failure') }} | |
run: exit 0 | |
- name: One or more tests failed | |
if: ${{ contains(needs.*.result, 'failure') }} | |
run: exit 1 | |
- name: debug-print | |
if: ${{ !cancelled() }} | |
run: | | |
echo "toJSON(needs) = ${{ toJSON(needs) }}" | |
echo "toJSON(needs.*.result) = ${{ toJSON(needs.*.result) }}" |