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

Refactor to composite GitHub Action with setup-java #174

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 0 additions & 10 deletions .github/workflows/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ jobs:
- run: npm ci
- run: npm run build
- run: npm run package
- uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4
if: ${{ env.ACT }}
with:
java-version: 11
distribution: zulu
- uses: ./
with:
version: ${{ matrix.nextflow_version }}
Expand All @@ -63,10 +58,5 @@ jobs:
- run: npm ci
- run: npm run build
- run: npm run package
- uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4
if: ${{ env.ACT}}
with:
java-version: 11
distribution: zulu
- uses: ./
- run: nextflow -v
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Composite GitHub Action now includes `setup-java` action with `java-version` (default `21`) and `java-distribution` (default `zulu`) inputs

### Changed

- Removed `setup-java` action from `.github/workflows/example.yml` as it is now part of the composite action

## [2.0.0] - 2024-03-01

### Added
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@ There are three (technically four) aliases to assist in choosing up-to-date Next

A boolean deciding whether to download the "all versions" distribution of Nextflow. May be useful for running tests against multiple versions downstream.

### `java-version`

> **default: `21`**

A version string to specify the version of Java to use.

### `java-distribution`

> **default: `zulu`**

A string to specify the Java distribution to use.

## Outputs

There are no outputs from this action.
Expand Down
46 changes: 42 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,54 @@ description: "Install Nextflow and add it to the PATH"
author: "nf-core"
inputs:
version:
description: "The Nextflow version to download (if necessary) and use. Example: 21.10.3"
description: "The Nextflow version to download and use."
required: false
default: "latest-stable"
all:
description: "Whether to install every Nextflow release via the '-all' distribution."
description: "Whether to install every Nextflow release."
required: false
default: false
java-version:
description: "The Java version to use."
required: false
default: "21"
java-distribution:
description: "The Java distribution to use."
required: false
default: "zulu"
runs:
using: "node20"
main: "dist/index.js"
using: "composite"
steps:
- name: Setup Java
uses: actions/setup-java@v2
with:
java-version: ${{ inputs.java-version }}
distribution: ${{ inputs.java-distribution }}

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

- name: Install dependencies
shell: bash
run: npm ci

- name: Install dependencies
shell: bash
run: npm run build

- name: Install dependencies
shell: bash
run: npm run package

- name: Install Nextflow
shell: bash
run: node lib/src/main.js
env:
VERSION: ${{ inputs.version }}
ALL: ${{ inputs.all }}

branding:
icon: "shuffle"
color: "green"
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
core.exportVariable("CAPSULE_LOG", "none")

// Read in the arguments
const version = core.getInput("version")
const get_all = core.getBooleanInput("all")
const version = process.env.VERSION;
const get_all = process.env.ALL;

// Check the cache for the Nextflow version that matched last time
if (check_cache(version)) {

Check failure on line 28 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-maximized-build-space

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 28 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest-everything, true)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 28 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest-stable, true)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 28 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (22.03.1-edge, false)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 28 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest-stable, false)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 28 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest, true)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 28 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (24.10.1, false)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 28 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (22.04, true)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 28 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest-everything, false)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 28 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (21.10.3, true)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 28 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (22.03.1-edge, true)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 28 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest-edge, true)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 28 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest, false)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 28 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (24.10.1, true)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 28 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest-edge, false)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 28 in src/main.ts

View workflow job for this annotation

GitHub Actions / test

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 28 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (21.10.3, false)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 28 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (22.04, false)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
return
}

Expand All @@ -33,13 +33,13 @@
let release = {} as NextflowRelease
let resolved_version = ""
try {
if (version.includes("latest")) {

Check failure on line 36 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-maximized-build-space

'version' is possibly 'undefined'.

Check failure on line 36 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest-everything, true)

'version' is possibly 'undefined'.

Check failure on line 36 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest-stable, true)

'version' is possibly 'undefined'.

Check failure on line 36 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (22.03.1-edge, false)

'version' is possibly 'undefined'.

Check failure on line 36 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest-stable, false)

'version' is possibly 'undefined'.

Check failure on line 36 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest, true)

'version' is possibly 'undefined'.

Check failure on line 36 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (24.10.1, false)

'version' is possibly 'undefined'.

Check failure on line 36 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (22.04, true)

'version' is possibly 'undefined'.

Check failure on line 36 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest-everything, false)

'version' is possibly 'undefined'.

Check failure on line 36 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (21.10.3, true)

'version' is possibly 'undefined'.

Check failure on line 36 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (22.03.1-edge, true)

'version' is possibly 'undefined'.

Check failure on line 36 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest-edge, true)

'version' is possibly 'undefined'.

Check failure on line 36 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest, false)

'version' is possibly 'undefined'.

Check failure on line 36 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (24.10.1, true)

'version' is possibly 'undefined'.

Check failure on line 36 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest-edge, false)

'version' is possibly 'undefined'.

Check failure on line 36 in src/main.ts

View workflow job for this annotation

GitHub Actions / test

'version' is possibly 'undefined'.

Check failure on line 36 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (21.10.3, false)

'version' is possibly 'undefined'.

Check failure on line 36 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (22.04, false)

'version' is possibly 'undefined'.
let flavor = version.split("-")[1]

Check failure on line 37 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-maximized-build-space

'version' is possibly 'undefined'.

Check failure on line 37 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest-everything, true)

'version' is possibly 'undefined'.

Check failure on line 37 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest-stable, true)

'version' is possibly 'undefined'.

Check failure on line 37 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (22.03.1-edge, false)

'version' is possibly 'undefined'.

Check failure on line 37 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest-stable, false)

'version' is possibly 'undefined'.

Check failure on line 37 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest, true)

'version' is possibly 'undefined'.

Check failure on line 37 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (24.10.1, false)

'version' is possibly 'undefined'.

Check failure on line 37 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (22.04, true)

'version' is possibly 'undefined'.

Check failure on line 37 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest-everything, false)

'version' is possibly 'undefined'.

Check failure on line 37 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (21.10.3, true)

'version' is possibly 'undefined'.

Check failure on line 37 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (22.03.1-edge, true)

'version' is possibly 'undefined'.

Check failure on line 37 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest-edge, true)

'version' is possibly 'undefined'.

Check failure on line 37 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest, false)

'version' is possibly 'undefined'.

Check failure on line 37 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (24.10.1, true)

'version' is possibly 'undefined'.

Check failure on line 37 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest-edge, false)

'version' is possibly 'undefined'.

Check failure on line 37 in src/main.ts

View workflow job for this annotation

GitHub Actions / test

'version' is possibly 'undefined'.

Check failure on line 37 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (21.10.3, false)

'version' is possibly 'undefined'.

Check failure on line 37 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (22.04, false)

'version' is possibly 'undefined'.
flavor = flavor ? flavor : "stable"
release = await get_latest_nextflow_version(flavor)
} else {
const nextflow_releases = await get_nextflow_versions()
release = await get_nextflow_release(version, nextflow_releases)

Check failure on line 42 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-maximized-build-space

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 42 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest-everything, true)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 42 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest-stable, true)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 42 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (22.03.1-edge, false)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 42 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest-stable, false)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 42 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest, true)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 42 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (24.10.1, false)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 42 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (22.04, true)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 42 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest-everything, false)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 42 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (21.10.3, true)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 42 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (22.03.1-edge, true)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 42 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest-edge, true)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 42 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest, false)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 42 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (24.10.1, true)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 42 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest-edge, false)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 42 in src/main.ts

View workflow job for this annotation

GitHub Actions / test

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 42 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (21.10.3, false)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

Check failure on line 42 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (22.04, false)

Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
}
resolved_version = release.version
core.info(
Expand All @@ -56,7 +56,7 @@
try {
// Download Nextflow and add it to path
if (!check_cache(resolved_version)) {
const nf_install_path = await install_nextflow(release, get_all)

Check failure on line 59 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-maximized-build-space

Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'.

Check failure on line 59 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest-everything, true)

Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'.

Check failure on line 59 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest-stable, true)

Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'.

Check failure on line 59 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (22.03.1-edge, false)

Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'.

Check failure on line 59 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest-stable, false)

Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'.

Check failure on line 59 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest, true)

Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'.

Check failure on line 59 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (24.10.1, false)

Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'.

Check failure on line 59 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (22.04, true)

Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'.

Check failure on line 59 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest-everything, false)

Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'.

Check failure on line 59 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (21.10.3, true)

Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'.

Check failure on line 59 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (22.03.1-edge, true)

Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'.

Check failure on line 59 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest-edge, true)

Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'.

Check failure on line 59 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest, false)

Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'.

Check failure on line 59 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (24.10.1, true)

Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'.

Check failure on line 59 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (latest-edge, false)

Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'.

Check failure on line 59 in src/main.ts

View workflow job for this annotation

GitHub Actions / test

Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'.

Check failure on line 59 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (21.10.3, false)

Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'.

Check failure on line 59 in src/main.ts

View workflow job for this annotation

GitHub Actions / example-usage (22.04, false)

Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'.
const cleaned_version = String(semver.clean(resolved_version, true))
const nf_path = await tc.cacheDir(
nf_install_path,
Expand Down
Loading