mirror of
https://github.com/MillironX/setup-nextflow.git
synced 2024-11-23 10:09:54 +00:00
Compare commits
21 commits
95fbb48328
...
2920d35b27
Author | SHA1 | Date | |
---|---|---|---|
2920d35b27 | |||
a0c983c7c0 | |||
ad13909a9c | |||
91a673d1c0 | |||
9c201e4232 | |||
063c2b071a | |||
f6ca4d60bb | |||
5d8e8fd6f5 | |||
0b5ecde5fa | |||
18999426ee | |||
d45224364c | |||
c7120cfa01 | |||
4b078199d1 | |||
d736e9561d | |||
71753bca1d | |||
4499488e7d | |||
1f1a43fb20 | |||
99243fb566 | |||
b9b7d187dd | |||
|
441990da28 | ||
|
7e43c4af0e |
11 changed files with 53 additions and 41 deletions
1
.envrc
1
.envrc
|
@ -1 +0,0 @@
|
|||
use nix
|
3
.github/workflows/test.yml
vendored
3
.github/workflows/test.yml
vendored
|
@ -26,3 +26,6 @@ jobs:
|
|||
- run: npm run test
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
- uses: codecov/codecov-action@v3
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
|
|
@ -7,9 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
|
||||
## [Unreleased]
|
||||
|
||||
## [1.4.0] - 2023-08-12
|
||||
|
||||
## Changed
|
||||
|
||||
- If `fs.renameSync` fails (e.g. because source and destination files are on different partitions), try `fs.copySync` and `fs.unlinkSync` instead (#14).
|
||||
- Fail instead of warn, when `nextflow help`` doesn't work (#23).
|
||||
|
||||
## Fixed
|
||||
|
||||
|
@ -55,7 +58,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||
- GitHub Actions workflow to test Nextflow installation and downstream usage
|
||||
- Documentation and license files
|
||||
|
||||
[unreleased]: https://github.com/nf-core/setup-nextflow/compare/v1.3.0...HEAD
|
||||
[unreleased]: https://github.com/nf-core/setup-nextflow/compare/v1.4.0...HEAD
|
||||
[1.4.0]: https://github.com/nf-core/setup-nextflow/compare/v1.3.0...v1.4.0
|
||||
[1.3.0]: https://github.com/nf-core/setup-nextflow/compare/v1.2.0...v1.3.0
|
||||
[1.2.0]: https://github.com/nf-core/setup-nextflow/compare/v1.1.1...v1.2.0
|
||||
[1.1.0]: https://github.com/nf-core/setup-nextflow/compare/v1.0.1...v1.1.0
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# ![nf-core/setup-nextflow](docs/images/nfcore-setupnextflow_logo.png#gh-light-mode-only) ![nf-core/setup-nextflow](docs/images/nfcore-setupnextflow_logo_dark.png#gh-dark-mode-only)
|
||||
|
||||
[![Testing](https://github.com/nf-core/setup-nextflow/actions/workflows/example.yml/badge.svg)](https://github.com/nf-core/setup-nextflow/actions/workflows/example.yml)
|
||||
[![codecov](https://codecov.io/gh/nf-core/setup-nextflow/branch/master/graph/badge.svg)](https://codecov.io/gh/nf-core/setup-nextflow)
|
||||
[![MIT License](https://img.shields.io/github/license/nf-core/setup-nextflow?logo=opensourceinitiative)](https://github.com/nf-core/setup-nextflow/blob/master/LICENSE)
|
||||
[![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/nf-core/setup-nextflow?logo=github)](https://github.com/nf-core/setup-nextflow/releases/latest)
|
||||
[![Get from GitHub Actions](https://img.shields.io/static/v1?label=actions&message=marketplace&color=green&logo=githubactions)](https://github.com/marketplace/actions/setup-nextflow)
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
{ pkgs ? import (fetchTarball "channel:nixos-23.05") {} }:
|
||||
|
||||
|
||||
pkgs.mkShell {
|
||||
buildInputs = [
|
||||
pkgs.nodejs
|
||||
];
|
||||
}
|
28
package-lock.json
generated
28
package-lock.json
generated
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "install-nextflow-action",
|
||||
"version": "1.3.0",
|
||||
"version": "1.4.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "install-nextflow-action",
|
||||
"version": "1.3.0",
|
||||
"version": "1.4.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.8.2",
|
||||
|
@ -433,9 +433,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@types/istanbul-lib-coverage": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz",
|
||||
"integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==",
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz",
|
||||
"integrity": "sha512-zONci81DZYCZjiLe0r6equvZut0b+dBRPBN5kBDjsONnutYNtJMoWQ9uR2RkL1gLG9NMTzvf+29e5RFfPbeKhQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/json-schema": {
|
||||
|
@ -4875,9 +4875,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/v8-to-istanbul/node_modules/@jridgewell/trace-mapping": {
|
||||
"version": "0.3.19",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz",
|
||||
"integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==",
|
||||
"version": "0.3.20",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz",
|
||||
"integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@jridgewell/resolve-uri": "^3.1.0",
|
||||
|
@ -5445,9 +5445,9 @@
|
|||
}
|
||||
},
|
||||
"@types/istanbul-lib-coverage": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz",
|
||||
"integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==",
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz",
|
||||
"integrity": "sha512-zONci81DZYCZjiLe0r6equvZut0b+dBRPBN5kBDjsONnutYNtJMoWQ9uR2RkL1gLG9NMTzvf+29e5RFfPbeKhQ==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/json-schema": {
|
||||
|
@ -8556,9 +8556,9 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@jridgewell/trace-mapping": {
|
||||
"version": "0.3.19",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz",
|
||||
"integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==",
|
||||
"version": "0.3.20",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz",
|
||||
"integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@jridgewell/resolve-uri": "^3.1.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "install-nextflow-action",
|
||||
"version": "1.3.0",
|
||||
"version": "1.4.0",
|
||||
"description": "An action to install Nextflow into a GitHub Actions workflow and make it available for subsequent steps.",
|
||||
"main": "lib/src/main.js",
|
||||
"scripts": {
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
* Houses the pertinent data that GitHub exposes for each Nextflow release
|
||||
*/
|
||||
export type NextflowRelease = {
|
||||
versionNumber: string;
|
||||
isEdge: boolean;
|
||||
binaryURL: string;
|
||||
allBinaryURL: string;
|
||||
versionNumber: string
|
||||
isEdge: boolean
|
||||
binaryURL: string
|
||||
allBinaryURL: string
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,9 +9,9 @@ const NEXTFLOW_REPO = { owner: "nextflow-io", repo: "nextflow" }
|
|||
export async function setup_octokit(
|
||||
github_token: string
|
||||
): Promise<InstanceType<typeof GitHub>> {
|
||||
let octokit = {} as InstanceType<typeof GitHub>
|
||||
let octokit = {} as InstanceType<typeof GitHub>
|
||||
try {
|
||||
octokit = github.getOctokit(github_token)
|
||||
octokit = github.getOctokit(github_token)
|
||||
} catch (e: unknown) {
|
||||
if (e instanceof Error) {
|
||||
core.setFailed(
|
||||
|
@ -19,7 +19,7 @@ export async function setup_octokit(
|
|||
)
|
||||
}
|
||||
}
|
||||
return octokit
|
||||
return octokit
|
||||
}
|
||||
|
||||
export async function pull_releases(
|
||||
|
@ -43,3 +43,20 @@ export async function all_nf_release_data(
|
|||
response => response.data
|
||||
)
|
||||
}
|
||||
|
||||
export async function latest_stable_release_data(
|
||||
ok: InstanceType<typeof GitHub>
|
||||
): Promise<object> {
|
||||
const { data: stable_release } = await ok.rest.repos.getLatestRelease(
|
||||
NEXTFLOW_REPO
|
||||
)
|
||||
|
||||
return stable_release
|
||||
}
|
||||
|
||||
export async function pull_latest_stable_release(
|
||||
ok: InstanceType<typeof GitHub>
|
||||
): Promise<NextflowRelease> {
|
||||
const latest_release = await latest_stable_release_data(ok)
|
||||
return nextflow_release(latest_release)
|
||||
}
|
||||
|
|
|
@ -25,13 +25,11 @@ function tag_filter(version: string): (NextflowRelease) => Boolean {
|
|||
filter = (r: NextflowRelease) => {
|
||||
return r.versionNumber.endsWith("-edge")
|
||||
}
|
||||
|
||||
} else {
|
||||
filter = (r: NextflowRelease) => {
|
||||
return !r.isEdge
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return filter
|
||||
}
|
||||
|
@ -41,7 +39,7 @@ export async function get_nextflow_release(
|
|||
releases: Array<NextflowRelease>
|
||||
): Promise<NextflowRelease> {
|
||||
// Filter the releases
|
||||
const filter = tag_filter(version);
|
||||
const filter = tag_filter(version)
|
||||
const matching_releases = releases.filter(filter)
|
||||
|
||||
matching_releases.sort((x, y) => {
|
||||
|
|
10
src/main.ts
10
src/main.ts
|
@ -34,8 +34,8 @@ async function run(): Promise<void> {
|
|||
const releases = await pull_releases(octokit)
|
||||
|
||||
// Get the release info for the desired release
|
||||
let release = {} as NextflowRelease;
|
||||
let resolved_version = "";
|
||||
let release = {} as NextflowRelease
|
||||
let resolved_version = ""
|
||||
try {
|
||||
release = await get_nextflow_release(version, releases)
|
||||
resolved_version = release.versionNumber
|
||||
|
@ -50,7 +50,6 @@ async function run(): Promise<void> {
|
|||
}
|
||||
}
|
||||
|
||||
// Get the download url for the desired release
|
||||
try {
|
||||
// Download Nextflow and add it to path
|
||||
if (!check_cache(resolved_version)) {
|
||||
|
@ -77,9 +76,8 @@ async function run(): Promise<void> {
|
|||
await exec.exec("nextflow", ["help"])
|
||||
} catch (e: unknown) {
|
||||
if (e instanceof Error) {
|
||||
core.warning(
|
||||
"Nextflow appears to have installed correctly, but an error was thrown while running it."
|
||||
)
|
||||
// fail workflow if Nextflow run does not succeed
|
||||
core.setFailed(`Could not run 'nextflow help'. Error: ${e.message}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue