Compare commits

..

2 commits

Author SHA1 Message Date
95fbb48328
wip: more work 2023-10-25 22:23:47 -05:00
5d5c2bcdc0
wip: Closer to MVC model 2023-09-26 17:25:10 -05:00
11 changed files with 41 additions and 53 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use nix

View file

@ -26,6 +26,3 @@ jobs:
- run: npm run test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

View file

@ -7,12 +7,9 @@ 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
@ -58,8 +55,7 @@ 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.4.0...HEAD
[1.4.0]: https://github.com/nf-core/setup-nextflow/compare/v1.3.0...v1.4.0
[unreleased]: https://github.com/nf-core/setup-nextflow/compare/v1.3.0...HEAD
[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

View file

@ -1,7 +1,6 @@
# ![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)

8
default.nix Normal file
View file

@ -0,0 +1,8 @@
{ pkgs ? import (fetchTarball "channel:nixos-23.05") {} }:
pkgs.mkShell {
buildInputs = [
pkgs.nodejs
];
}

28
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "install-nextflow-action",
"version": "1.4.0",
"version": "1.3.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "install-nextflow-action",
"version": "1.4.0",
"version": "1.3.0",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.8.2",
@ -433,9 +433,9 @@
}
},
"node_modules/@types/istanbul-lib-coverage": {
"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==",
"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==",
"dev": true
},
"node_modules/@types/json-schema": {
@ -4875,9 +4875,9 @@
}
},
"node_modules/v8-to-istanbul/node_modules/@jridgewell/trace-mapping": {
"version": "0.3.20",
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz",
"integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==",
"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==",
"dev": true,
"dependencies": {
"@jridgewell/resolve-uri": "^3.1.0",
@ -5445,9 +5445,9 @@
}
},
"@types/istanbul-lib-coverage": {
"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==",
"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==",
"dev": true
},
"@types/json-schema": {
@ -8556,9 +8556,9 @@
},
"dependencies": {
"@jridgewell/trace-mapping": {
"version": "0.3.20",
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz",
"integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==",
"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==",
"dev": true,
"requires": {
"@jridgewell/resolve-uri": "^3.1.0",

View file

@ -1,6 +1,6 @@
{
"name": "install-nextflow-action",
"version": "1.4.0",
"version": "1.3.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": {

View file

@ -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;
}
/**

View file

@ -43,20 +43,3 @@ 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)
}

View file

@ -25,11 +25,13 @@ function tag_filter(version: string): (NextflowRelease) => Boolean {
filter = (r: NextflowRelease) => {
return r.versionNumber.endsWith("-edge")
}
} else {
filter = (r: NextflowRelease) => {
return !r.isEdge
}
}
}
return filter
}
@ -39,7 +41,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) => {

View file

@ -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,6 +50,7 @@ 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)) {
@ -76,8 +77,9 @@ async function run(): Promise<void> {
await exec.exec("nextflow", ["help"])
} catch (e: unknown) {
if (e instanceof Error) {
// fail workflow if Nextflow run does not succeed
core.setFailed(`Could not run 'nextflow help'. Error: ${e.message}`)
core.warning(
"Nextflow appears to have installed correctly, but an error was thrown while running it."
)
}
}
}