mirror of
https://github.com/MillironX/setup-nextflow.git
synced 2024-11-23 10:09:54 +00:00
Compare commits
2 commits
2920d35b27
...
95fbb48328
Author | SHA1 | Date | |
---|---|---|---|
95fbb48328 | |||
5d5c2bcdc0 |
10 changed files with 571 additions and 151 deletions
1
.envrc
Normal file
1
.envrc
Normal file
|
@ -0,0 +1 @@
|
|||
use nix
|
8
default.nix
Normal file
8
default.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{ pkgs ? import (fetchTarball "channel:nixos-23.05") {} }:
|
||||
|
||||
|
||||
pkgs.mkShell {
|
||||
buildInputs = [
|
||||
pkgs.nodejs
|
||||
];
|
||||
}
|
318
package-lock.json
generated
318
package-lock.json
generated
|
@ -6,7 +6,7 @@
|
|||
"packages": {
|
||||
"": {
|
||||
"name": "install-nextflow-action",
|
||||
"version": "1.2.0",
|
||||
"version": "1.3.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.8.2",
|
||||
|
@ -26,6 +26,7 @@
|
|||
"@typescript-eslint/parser": "^5.42.1",
|
||||
"@vercel/ncc": "^0.34.0",
|
||||
"ava": "^5.0.1",
|
||||
"c8": "^8.0.1",
|
||||
"eslint": "^8.27.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-ava": "^13.2.0",
|
||||
|
@ -148,6 +149,12 @@
|
|||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@bcoe/v8-coverage": {
|
||||
"version": "0.2.3",
|
||||
"resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz",
|
||||
"integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@cspotcode/source-map-support": {
|
||||
"version": "0.8.1",
|
||||
"resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz",
|
||||
|
@ -222,6 +229,15 @@
|
|||
"integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@istanbuljs/schema": {
|
||||
"version": "0.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz",
|
||||
"integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/@jridgewell/resolve-uri": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz",
|
||||
|
@ -416,6 +432,12 @@
|
|||
"@types/retry": "*"
|
||||
}
|
||||
},
|
||||
"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==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/json-schema": {
|
||||
"version": "7.0.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz",
|
||||
|
@ -1136,6 +1158,32 @@
|
|||
"node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
|
||||
}
|
||||
},
|
||||
"node_modules/c8": {
|
||||
"version": "8.0.1",
|
||||
"resolved": "https://registry.npmjs.org/c8/-/c8-8.0.1.tgz",
|
||||
"integrity": "sha512-EINpopxZNH1mETuI0DzRA4MZpAUH+IFiRhnmFD3vFr3vdrgxqi3VfE3KL0AIL+zDq8rC9bZqwM/VDmmoe04y7w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@bcoe/v8-coverage": "^0.2.3",
|
||||
"@istanbuljs/schema": "^0.1.3",
|
||||
"find-up": "^5.0.0",
|
||||
"foreground-child": "^2.0.0",
|
||||
"istanbul-lib-coverage": "^3.2.0",
|
||||
"istanbul-lib-report": "^3.0.1",
|
||||
"istanbul-reports": "^3.1.6",
|
||||
"rimraf": "^3.0.2",
|
||||
"test-exclude": "^6.0.0",
|
||||
"v8-to-istanbul": "^9.0.0",
|
||||
"yargs": "^17.7.2",
|
||||
"yargs-parser": "^21.1.1"
|
||||
},
|
||||
"bin": {
|
||||
"c8": "bin/c8.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/call-bind": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
|
||||
|
@ -1415,6 +1463,12 @@
|
|||
"node": ">=10.18.0 <11 || >=12.14.0 <13 || >=14"
|
||||
}
|
||||
},
|
||||
"node_modules/convert-source-map": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz",
|
||||
"integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/convert-to-spaces": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/convert-to-spaces/-/convert-to-spaces-2.0.1.tgz",
|
||||
|
@ -2452,6 +2506,19 @@
|
|||
"integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/foreground-child": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz",
|
||||
"integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"cross-spawn": "^7.0.0",
|
||||
"signal-exit": "^3.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
|
@ -2704,6 +2771,12 @@
|
|||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/html-escaper": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz",
|
||||
"integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/human-signals": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz",
|
||||
|
@ -3108,6 +3181,42 @@
|
|||
"integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/istanbul-lib-coverage": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz",
|
||||
"integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/istanbul-lib-report": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz",
|
||||
"integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"istanbul-lib-coverage": "^3.0.0",
|
||||
"make-dir": "^4.0.0",
|
||||
"supports-color": "^7.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/istanbul-reports": {
|
||||
"version": "3.1.6",
|
||||
"resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz",
|
||||
"integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"html-escaper": "^2.0.0",
|
||||
"istanbul-lib-report": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/js-sdsl": {
|
||||
"version": "4.1.5",
|
||||
"resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.1.5.tgz",
|
||||
|
@ -3274,6 +3383,21 @@
|
|||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/make-dir": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz",
|
||||
"integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"semver": "^7.5.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/make-error": {
|
||||
"version": "1.3.6",
|
||||
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
|
||||
|
@ -4133,9 +4257,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/semver": {
|
||||
"version": "7.3.7",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz",
|
||||
"integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==",
|
||||
"version": "7.5.4",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
|
||||
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
|
||||
"dependencies": {
|
||||
"lru-cache": "^6.0.0"
|
||||
},
|
||||
|
@ -4499,6 +4623,20 @@
|
|||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/test-exclude": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz",
|
||||
"integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@istanbuljs/schema": "^0.1.2",
|
||||
"glob": "^7.1.4",
|
||||
"minimatch": "^3.0.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/text-table": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
|
||||
|
@ -4722,6 +4860,30 @@
|
|||
"integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/v8-to-istanbul": {
|
||||
"version": "9.1.3",
|
||||
"resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.3.tgz",
|
||||
"integrity": "sha512-9lDD+EVI2fjFsMWXc6dy5JJzBsVTcQ2fVkfBvncZ6xJWG9wtBhOldG+mHkSL0+V1K/xgZz0JDO5UT5hFwHUghg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@jridgewell/trace-mapping": "^0.3.12",
|
||||
"@types/istanbul-lib-coverage": "^2.0.1",
|
||||
"convert-source-map": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.12.0"
|
||||
}
|
||||
},
|
||||
"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==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@jridgewell/resolve-uri": "^3.1.0",
|
||||
"@jridgewell/sourcemap-codec": "^1.4.14"
|
||||
}
|
||||
},
|
||||
"node_modules/webidl-conversions": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||
|
@ -4864,9 +5026,9 @@
|
|||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
|
||||
},
|
||||
"node_modules/yargs": {
|
||||
"version": "17.6.2",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.2.tgz",
|
||||
"integrity": "sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==",
|
||||
"version": "17.7.2",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",
|
||||
"integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"cliui": "^8.0.1",
|
||||
|
@ -5039,6 +5201,12 @@
|
|||
"regenerator-runtime": "^0.13.10"
|
||||
}
|
||||
},
|
||||
"@bcoe/v8-coverage": {
|
||||
"version": "0.2.3",
|
||||
"resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz",
|
||||
"integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==",
|
||||
"dev": true
|
||||
},
|
||||
"@cspotcode/source-map-support": {
|
||||
"version": "0.8.1",
|
||||
"resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz",
|
||||
|
@ -5094,6 +5262,12 @@
|
|||
"integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==",
|
||||
"dev": true
|
||||
},
|
||||
"@istanbuljs/schema": {
|
||||
"version": "0.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz",
|
||||
"integrity": "sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==",
|
||||
"dev": true
|
||||
},
|
||||
"@jridgewell/resolve-uri": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz",
|
||||
|
@ -5270,6 +5444,12 @@
|
|||
"@types/retry": "*"
|
||||
}
|
||||
},
|
||||
"@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==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/json-schema": {
|
||||
"version": "7.0.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz",
|
||||
|
@ -5754,6 +5934,26 @@
|
|||
"update-browserslist-db": "^1.0.9"
|
||||
}
|
||||
},
|
||||
"c8": {
|
||||
"version": "8.0.1",
|
||||
"resolved": "https://registry.npmjs.org/c8/-/c8-8.0.1.tgz",
|
||||
"integrity": "sha512-EINpopxZNH1mETuI0DzRA4MZpAUH+IFiRhnmFD3vFr3vdrgxqi3VfE3KL0AIL+zDq8rC9bZqwM/VDmmoe04y7w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@bcoe/v8-coverage": "^0.2.3",
|
||||
"@istanbuljs/schema": "^0.1.3",
|
||||
"find-up": "^5.0.0",
|
||||
"foreground-child": "^2.0.0",
|
||||
"istanbul-lib-coverage": "^3.2.0",
|
||||
"istanbul-lib-report": "^3.0.1",
|
||||
"istanbul-reports": "^3.1.6",
|
||||
"rimraf": "^3.0.2",
|
||||
"test-exclude": "^6.0.0",
|
||||
"v8-to-istanbul": "^9.0.0",
|
||||
"yargs": "^17.7.2",
|
||||
"yargs-parser": "^21.1.1"
|
||||
}
|
||||
},
|
||||
"call-bind": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
|
||||
|
@ -5961,6 +6161,12 @@
|
|||
"well-known-symbols": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"convert-source-map": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz",
|
||||
"integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==",
|
||||
"dev": true
|
||||
},
|
||||
"convert-to-spaces": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/convert-to-spaces/-/convert-to-spaces-2.0.1.tgz",
|
||||
|
@ -6732,6 +6938,16 @@
|
|||
"integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==",
|
||||
"dev": true
|
||||
},
|
||||
"foreground-child": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz",
|
||||
"integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"cross-spawn": "^7.0.0",
|
||||
"signal-exit": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"fs.realpath": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||
|
@ -6905,6 +7121,12 @@
|
|||
"has-symbols": "^1.0.2"
|
||||
}
|
||||
},
|
||||
"html-escaper": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz",
|
||||
"integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==",
|
||||
"dev": true
|
||||
},
|
||||
"human-signals": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz",
|
||||
|
@ -7171,6 +7393,33 @@
|
|||
"integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
|
||||
"dev": true
|
||||
},
|
||||
"istanbul-lib-coverage": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz",
|
||||
"integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==",
|
||||
"dev": true
|
||||
},
|
||||
"istanbul-lib-report": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz",
|
||||
"integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"istanbul-lib-coverage": "^3.0.0",
|
||||
"make-dir": "^4.0.0",
|
||||
"supports-color": "^7.1.0"
|
||||
}
|
||||
},
|
||||
"istanbul-reports": {
|
||||
"version": "3.1.6",
|
||||
"resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz",
|
||||
"integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"html-escaper": "^2.0.0",
|
||||
"istanbul-lib-report": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"js-sdsl": {
|
||||
"version": "4.1.5",
|
||||
"resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.1.5.tgz",
|
||||
|
@ -7307,6 +7556,15 @@
|
|||
"yallist": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"make-dir": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz",
|
||||
"integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"semver": "^7.5.3"
|
||||
}
|
||||
},
|
||||
"make-error": {
|
||||
"version": "1.3.6",
|
||||
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
|
||||
|
@ -7873,9 +8131,9 @@
|
|||
}
|
||||
},
|
||||
"semver": {
|
||||
"version": "7.3.7",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz",
|
||||
"integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==",
|
||||
"version": "7.5.4",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
|
||||
"integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
|
||||
"requires": {
|
||||
"lru-cache": "^6.0.0"
|
||||
}
|
||||
|
@ -8128,6 +8386,17 @@
|
|||
"integrity": "sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg==",
|
||||
"dev": true
|
||||
},
|
||||
"test-exclude": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz",
|
||||
"integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@istanbuljs/schema": "^0.1.2",
|
||||
"glob": "^7.1.4",
|
||||
"minimatch": "^3.0.4"
|
||||
}
|
||||
},
|
||||
"text-table": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
|
||||
|
@ -8275,6 +8544,29 @@
|
|||
"integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==",
|
||||
"dev": true
|
||||
},
|
||||
"v8-to-istanbul": {
|
||||
"version": "9.1.3",
|
||||
"resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.3.tgz",
|
||||
"integrity": "sha512-9lDD+EVI2fjFsMWXc6dy5JJzBsVTcQ2fVkfBvncZ6xJWG9wtBhOldG+mHkSL0+V1K/xgZz0JDO5UT5hFwHUghg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@jridgewell/trace-mapping": "^0.3.12",
|
||||
"@types/istanbul-lib-coverage": "^2.0.1",
|
||||
"convert-source-map": "^2.0.0"
|
||||
},
|
||||
"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==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@jridgewell/resolve-uri": "^3.1.0",
|
||||
"@jridgewell/sourcemap-codec": "^1.4.14"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"webidl-conversions": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||
|
@ -8386,9 +8678,9 @@
|
|||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
|
||||
},
|
||||
"yargs": {
|
||||
"version": "17.6.2",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.2.tgz",
|
||||
"integrity": "sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==",
|
||||
"version": "17.7.2",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",
|
||||
"integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"cliui": "^8.0.1",
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
"lint": "eslint {src,test}/**/*.ts",
|
||||
"lint:fix": "eslint --fix {src,test}/**/*.ts",
|
||||
"package": "ncc build --source-map --license LICENSE",
|
||||
"test": "ava",
|
||||
"test": "c8 --reporter=lcov ava",
|
||||
"all": "npm run build && npm run format && npm run lint && npm run package && npm test"
|
||||
},
|
||||
"repository": {
|
||||
|
@ -63,6 +63,7 @@
|
|||
"@typescript-eslint/parser": "^5.42.1",
|
||||
"@vercel/ncc": "^0.34.0",
|
||||
"ava": "^5.0.1",
|
||||
"c8": "^8.0.1",
|
||||
"eslint": "^8.27.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-plugin-ava": "^13.2.0",
|
||||
|
|
44
src/NextflowRelease.ts
Normal file
44
src/NextflowRelease.ts
Normal file
|
@ -0,0 +1,44 @@
|
|||
/**
|
||||
* Houses the pertinent data that GitHub exposes for each Nextflow release
|
||||
*/
|
||||
export type NextflowRelease = {
|
||||
versionNumber: string;
|
||||
isEdge: boolean;
|
||||
binaryURL: string;
|
||||
allBinaryURL: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the raw OctoKit data into a structured NextflowRelease
|
||||
* @param data A "release" data struct from OctoKit
|
||||
* @returns `data` converted into a `NextflowRelease`
|
||||
*/
|
||||
export function nextflow_release(data: object) {
|
||||
const nf_release: NextflowRelease = {
|
||||
versionNumber: data["tag_name"],
|
||||
isEdge: data["prerelease"],
|
||||
binaryURL: nextflow_bin_url(data, false),
|
||||
allBinaryURL: nextflow_bin_url(data, true)
|
||||
}
|
||||
return nf_release
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the download URL of a Nextflow binary
|
||||
* @param release A "release" data struct from OctoKit
|
||||
* @param get_all Whether to return the url for the "all" variant of Nextflow
|
||||
* @returns The URL of the Nextflow binary
|
||||
*/
|
||||
export function nextflow_bin_url(release: object, get_all: boolean): string {
|
||||
const release_assets = release["assets"]
|
||||
const all_asset = release_assets.filter((a: object) => {
|
||||
return a["browser_download_url"].endsWith("-all")
|
||||
})[0]
|
||||
const regular_asset = release_assets.filter((a: object) => {
|
||||
return a["name"] === "nextflow"
|
||||
})[0]
|
||||
|
||||
const dl_asset = get_all ? all_asset : regular_asset
|
||||
|
||||
return dl_asset.browser_download_url
|
||||
}
|
45
src/OctokitWrapper.ts
Normal file
45
src/OctokitWrapper.ts
Normal file
|
@ -0,0 +1,45 @@
|
|||
import { GitHub } from "@actions/github/lib/utils"
|
||||
import * as github from "@actions/github"
|
||||
import * as core from "@actions/core"
|
||||
|
||||
import { NextflowRelease, nextflow_release } from "./NextflowRelease"
|
||||
|
||||
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>
|
||||
try {
|
||||
octokit = github.getOctokit(github_token)
|
||||
} catch (e: unknown) {
|
||||
if (e instanceof Error) {
|
||||
core.setFailed(
|
||||
`Could not authenticate to GitHub Releases API with provided token\n${e.message}`
|
||||
)
|
||||
}
|
||||
}
|
||||
return octokit
|
||||
}
|
||||
|
||||
export async function pull_releases(
|
||||
octokit: InstanceType<typeof GitHub>
|
||||
): Promise<Array<NextflowRelease>> {
|
||||
const all_release_data: object[] = await all_nf_release_data(octokit)
|
||||
var all_releases: NextflowRelease[] = []
|
||||
all_release_data.forEach(data => {
|
||||
all_releases.push(nextflow_release(data))
|
||||
})
|
||||
|
||||
return all_releases
|
||||
}
|
||||
|
||||
export async function all_nf_release_data(
|
||||
ok: InstanceType<typeof GitHub>
|
||||
): Promise<object[]> {
|
||||
return await ok.paginate(
|
||||
ok.rest.repos.listReleases,
|
||||
NEXTFLOW_REPO,
|
||||
response => response.data
|
||||
)
|
||||
}
|
|
@ -1,41 +1,15 @@
|
|||
import * as core from "@actions/core"
|
||||
import { GitHub } from "@actions/github/lib/utils"
|
||||
import * as tc from "@actions/tool-cache"
|
||||
import retry from "async-retry"
|
||||
import * as fs from "fs"
|
||||
import semver from "semver"
|
||||
|
||||
const NEXTFLOW_REPO = { owner: "nextflow-io", repo: "nextflow" }
|
||||
import { NextflowRelease } from "./NextflowRelease"
|
||||
|
||||
// HACK Private but I want to test this
|
||||
export async function all_nf_releases(
|
||||
ok: InstanceType<typeof GitHub>
|
||||
): Promise<object[]> {
|
||||
return await ok.paginate(
|
||||
ok.rest.repos.listReleases,
|
||||
NEXTFLOW_REPO,
|
||||
response => response.data
|
||||
)
|
||||
}
|
||||
|
||||
// HACK Private but I want to test this
|
||||
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 release_data(
|
||||
version: string,
|
||||
ok: InstanceType<typeof GitHub>
|
||||
): Promise<object> {
|
||||
function tag_filter(version: string): (NextflowRelease) => Boolean {
|
||||
// Setup tag-based filtering
|
||||
let filter = (r: object): boolean => {
|
||||
return semver.satisfies(r["tag_name"], version, true)
|
||||
let filter = (r: NextflowRelease): boolean => {
|
||||
return semver.satisfies(r.versionNumber, version, true)
|
||||
}
|
||||
|
||||
// Check if the user passed a 'latest*' tag, and override filtering
|
||||
|
@ -44,52 +18,47 @@ export async function release_data(
|
|||
if (version.includes("-everything")) {
|
||||
// No filtering
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
filter = (r: object) => {
|
||||
filter = (r: NextflowRelease) => {
|
||||
return true
|
||||
}
|
||||
} else if (version.includes("-edge")) {
|
||||
filter = r => {
|
||||
return r["tag_name"].endsWith("-edge")
|
||||
filter = (r: NextflowRelease) => {
|
||||
return r.versionNumber.endsWith("-edge")
|
||||
}
|
||||
|
||||
} else {
|
||||
// This is special: passing 'latest' or 'latest-stable' allows us to use
|
||||
// the latest stable GitHub release direct from the API
|
||||
const stable_release = await latest_stable_release_data(ok)
|
||||
return stable_release
|
||||
filter = (r: NextflowRelease) => {
|
||||
return !r.isEdge
|
||||
}
|
||||
}
|
||||
|
||||
// Get all the releases
|
||||
const all_releases: object[] = await all_nf_releases(ok)
|
||||
}
|
||||
return filter
|
||||
}
|
||||
|
||||
const matching_releases = all_releases.filter(filter)
|
||||
export async function get_nextflow_release(
|
||||
version: string,
|
||||
releases: Array<NextflowRelease>
|
||||
): Promise<NextflowRelease> {
|
||||
// Filter the releases
|
||||
const filter = tag_filter(version);
|
||||
const matching_releases = releases.filter(filter)
|
||||
|
||||
matching_releases.sort((x, y) => {
|
||||
// HACK IDK why the value flip is necessary with the return
|
||||
return semver.compare(x["tag_name"], y["tag_name"], true) * -1
|
||||
return semver.compare(x.versionNumber, y.versionNumber, true) * -1
|
||||
})
|
||||
|
||||
return matching_releases[0]
|
||||
}
|
||||
|
||||
export function nextflow_bin_url(release: object, get_all: boolean): string {
|
||||
const release_assets = release["assets"]
|
||||
const all_asset = release_assets.filter((a: object) => {
|
||||
return a["browser_download_url"].endsWith("-all")
|
||||
})[0]
|
||||
const regular_asset = release_assets.filter((a: object) => {
|
||||
return a["name"] === "nextflow"
|
||||
})[0]
|
||||
|
||||
const dl_asset = get_all ? all_asset : regular_asset
|
||||
|
||||
return dl_asset.browser_download_url
|
||||
}
|
||||
|
||||
export async function install_nextflow(
|
||||
url: string,
|
||||
version: string
|
||||
release: NextflowRelease,
|
||||
get_all: boolean
|
||||
): Promise<string> {
|
||||
const url = get_all ? release.allBinaryURL : release.binaryURL
|
||||
const version = release.versionNumber
|
||||
|
||||
core.debug(`Downloading Nextflow from ${url}`)
|
||||
const nf_dl_path = await retry(
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
|
|
45
src/main.ts
45
src/main.ts
|
@ -1,7 +1,5 @@
|
|||
import * as core from "@actions/core"
|
||||
import * as exec from "@actions/exec"
|
||||
import * as github from "@actions/github"
|
||||
import { GitHub } from "@actions/github/lib/utils"
|
||||
import * as tc from "@actions/tool-cache"
|
||||
import * as fs from "fs"
|
||||
import semver from "semver"
|
||||
|
@ -9,12 +7,15 @@ import semver from "semver"
|
|||
import {
|
||||
check_cache,
|
||||
install_nextflow,
|
||||
nextflow_bin_url,
|
||||
release_data
|
||||
get_nextflow_release
|
||||
} from "./functions"
|
||||
|
||||
import { NextflowRelease } from "./NextflowRelease"
|
||||
import { pull_releases, setup_octokit } from "./OctokitWrapper"
|
||||
|
||||
async function run(): Promise<void> {
|
||||
// Set environment variables
|
||||
// CAPSULE_LOG leads to a bunch of boilerplate being output to the logs: turn
|
||||
// it off
|
||||
core.exportVariable("CAPSULE_LOG", "none")
|
||||
|
||||
// Read in the arguments
|
||||
|
@ -28,25 +29,16 @@ async function run(): Promise<void> {
|
|||
}
|
||||
|
||||
// Setup the API
|
||||
let octokit: InstanceType<typeof GitHub> | undefined
|
||||
try {
|
||||
octokit = github.getOctokit(token)
|
||||
} catch (e: unknown) {
|
||||
if (e instanceof Error) {
|
||||
core.setFailed(
|
||||
`Could not authenticate to GitHub Releases API with provided token\n${e.message}`
|
||||
)
|
||||
}
|
||||
}
|
||||
const octokit = await setup_octokit(token)
|
||||
|
||||
const releases = await pull_releases(octokit)
|
||||
|
||||
// Get the release info for the desired release
|
||||
let release = {}
|
||||
let resolved_version = ""
|
||||
let release = {} as NextflowRelease;
|
||||
let resolved_version = "";
|
||||
try {
|
||||
if (octokit !== undefined) {
|
||||
release = await release_data(version, octokit)
|
||||
}
|
||||
resolved_version = release["tag_name"]
|
||||
release = await get_nextflow_release(version, releases)
|
||||
resolved_version = release.versionNumber
|
||||
core.info(
|
||||
`Input version '${version}' resolved to Nextflow ${release["name"]}`
|
||||
)
|
||||
|
@ -59,19 +51,10 @@ async function run(): Promise<void> {
|
|||
}
|
||||
|
||||
// Get the download url for the desired release
|
||||
let url = ""
|
||||
try {
|
||||
url = nextflow_bin_url(release, get_all)
|
||||
core.info(`Preparing to download from ${url}`)
|
||||
} catch (e: unknown) {
|
||||
if (e instanceof Error) {
|
||||
core.setFailed(`Could not parse the download URL\n${e.message}`)
|
||||
}
|
||||
}
|
||||
try {
|
||||
// Download Nextflow and add it to path
|
||||
if (!check_cache(resolved_version)) {
|
||||
const nf_install_path = await install_nextflow(url, resolved_version)
|
||||
const nf_install_path = await install_nextflow(release, get_all)
|
||||
const cleaned_version = String(semver.clean(resolved_version, true))
|
||||
const nf_path = await tc.cacheDir(
|
||||
nf_install_path,
|
||||
|
|
|
@ -1,37 +1,113 @@
|
|||
import * as github from "@actions/github"
|
||||
import { GitHub } from "@actions/github/lib/utils"
|
||||
import anyTest, { TestFn } from "ava" // eslint-disable-line import/no-unresolved
|
||||
import test from "ava" // eslint-disable-line import/no-unresolved
|
||||
|
||||
import * as functions from "../src/functions"
|
||||
import { getReleaseTag, getToken } from "./utils"
|
||||
import { NextflowRelease } from "../src/NextflowRelease"
|
||||
|
||||
const test = anyTest as TestFn<{
|
||||
token: string
|
||||
octokit: InstanceType<typeof GitHub>
|
||||
}>
|
||||
|
||||
test.before(t => {
|
||||
const first = true
|
||||
const current_token = getToken(first)
|
||||
t.context = {
|
||||
token: current_token,
|
||||
octokit: github.getOctokit(current_token)
|
||||
// The Nextflow releases we are going to use for testing follow a regular
|
||||
// pattern: create a mock function to bootstrap some test data without repeating
|
||||
// ourselves
|
||||
function nf_release_gen(version_number: string): NextflowRelease {
|
||||
const is_edge = version_number.endsWith("-edge")
|
||||
const release: NextflowRelease = {
|
||||
versionNumber: version_number,
|
||||
isEdge: is_edge,
|
||||
binaryURL: `https://github.com/nextflow-io/nextflow/releases/download/${version_number}/nextflow`,
|
||||
allBinaryURL: `https://github.com/nextflow-io/nextflow/releases/download/${version_number}/nextflow-${version_number.replace(
|
||||
"v",
|
||||
""
|
||||
)}-all`
|
||||
}
|
||||
})
|
||||
return release
|
||||
}
|
||||
|
||||
test("all_nf_releases", async t => {
|
||||
const result = await functions.all_nf_releases(t.context["octokit"])
|
||||
t.is(typeof result, "object")
|
||||
})
|
||||
// A mock set of Nextflow releases
|
||||
const edge_is_newer = [
|
||||
nf_release_gen("v23.09.1-edge"),
|
||||
nf_release_gen("v23.04.3"),
|
||||
nf_release_gen("v23.04.2")
|
||||
]
|
||||
const edge_is_older = [
|
||||
nf_release_gen("v23.04.3"),
|
||||
nf_release_gen("v23.04.2"),
|
||||
nf_release_gen("v23.03.0-edge")
|
||||
]
|
||||
|
||||
test("lastest_stable_release_data", async t => {
|
||||
const result = await functions.latest_stable_release_data(
|
||||
t.context["octokit"]
|
||||
/*
|
||||
The whole reason this action exists is to handle the cases where a final
|
||||
release is the "bleeding edge" release, rather than the "edge" release, even
|
||||
though that's what the name would imply. Therefore, we need to test that the
|
||||
'latest-everything' parameter can find the correct one regardless of whether
|
||||
an "edge" release or a stable release is the true latest
|
||||
*/
|
||||
const release_filter_macro = test.macro(
|
||||
async (
|
||||
t,
|
||||
input_version: string,
|
||||
expected_version: string,
|
||||
releases: Array<NextflowRelease>
|
||||
) => {
|
||||
const matched_release = await functions.get_nextflow_release(
|
||||
input_version,
|
||||
releases
|
||||
)
|
||||
t.is(typeof result, "object")
|
||||
const expected = await getReleaseTag("nextflow-io/nextflow", false)
|
||||
t.is(result["tag_name"], expected)
|
||||
})
|
||||
t.is(matched_release.versionNumber, expected_version)
|
||||
}
|
||||
)
|
||||
test(
|
||||
"Latest-everything install with newer edge release",
|
||||
release_filter_macro,
|
||||
"latest-everything",
|
||||
"v23.09.1-edge",
|
||||
edge_is_newer
|
||||
)
|
||||
test(
|
||||
"Latest-everything install with older edge release",
|
||||
release_filter_macro,
|
||||
"latest-everything",
|
||||
"v23.04.3",
|
||||
edge_is_older
|
||||
)
|
||||
test(
|
||||
"Latest-edge install with newer edge release",
|
||||
release_filter_macro,
|
||||
"latest-edge",
|
||||
"v23.09.1-edge",
|
||||
edge_is_newer
|
||||
)
|
||||
test(
|
||||
"Latest-edge install with older edge release",
|
||||
release_filter_macro,
|
||||
"latest-edge",
|
||||
"v23.03.0-edge",
|
||||
edge_is_older
|
||||
)
|
||||
test(
|
||||
"Latest-stable install with newer edge release",
|
||||
release_filter_macro,
|
||||
"latest",
|
||||
"v23.04.3",
|
||||
edge_is_newer
|
||||
)
|
||||
test(
|
||||
"Latest-stable install with older edge release",
|
||||
release_filter_macro,
|
||||
"latest",
|
||||
"v23.04.3",
|
||||
edge_is_older
|
||||
)
|
||||
test(
|
||||
"Fully versioned tag release",
|
||||
release_filter_macro,
|
||||
"v23.04.2",
|
||||
"v23.04.2",
|
||||
edge_is_newer
|
||||
)
|
||||
test(
|
||||
"Partially versioned tag release",
|
||||
release_filter_macro,
|
||||
"v23.04",
|
||||
"v23.04.3",
|
||||
edge_is_newer
|
||||
)
|
||||
|
||||
test.todo("nextflow_bin_url")
|
||||
test.todo("install_nextflow")
|
||||
|
|
|
@ -2,8 +2,9 @@ import * as github from "@actions/github"
|
|||
import { GitHub } from "@actions/github/lib/utils"
|
||||
import anyTest, { TestFn } from "ava" // eslint-disable-line import/no-unresolved
|
||||
|
||||
import { release_data } from "../src/functions"
|
||||
import { getReleaseTag, getToken } from "./utils"
|
||||
import { getToken } from "./utils"
|
||||
import { all_nf_release_data } from "../src/OctokitWrapper"
|
||||
import { nextflow_bin_url } from "../src/NextflowRelease"
|
||||
|
||||
const test = anyTest as TestFn<{
|
||||
token: string
|
||||
|
@ -19,22 +20,22 @@ test.before(t => {
|
|||
}
|
||||
})
|
||||
|
||||
const macro = test.macro(async (t, version: string) => {
|
||||
let expected
|
||||
if (version === "latest-stable") {
|
||||
expected = await getReleaseTag("nextflow-io/nextflow", false)
|
||||
} else if (version === "latest-edge") {
|
||||
expected = await getReleaseTag("nextflow-io/nextflow", true)
|
||||
} else if (version === "latest-everything") {
|
||||
expected = await getReleaseTag("nextflow-io/nextflow", undefined)
|
||||
} else {
|
||||
expected = version
|
||||
}
|
||||
const result = await release_data(version, t.context["octokit"])
|
||||
t.is(result["tag_name"], expected)
|
||||
const exists_macro = test.macro(async (t, object_name: string) => {
|
||||
const all_releases = await all_nf_release_data(t.context.octokit)
|
||||
const first_release = all_releases[0]
|
||||
t.assert(first_release.hasOwnProperty(object_name))
|
||||
})
|
||||
|
||||
test("hard version", macro, "v22.10.2")
|
||||
test("latest-stable", macro, "latest-stable")
|
||||
test("latest-edge", macro, "latest-edge")
|
||||
test("latest-everything", macro, "latest-everything")
|
||||
test("OctoKit returns tag", exists_macro, "tag_name")
|
||||
test("Octokit returns prerelease", exists_macro, "prerelease")
|
||||
test("Octokit returns assets", exists_macro, "assets")
|
||||
|
||||
const binary_url_macro = test.macro(async (t, get_all: boolean) => {
|
||||
const all_releases = await all_nf_release_data(t.context.octokit)
|
||||
const first_release = all_releases[0]
|
||||
const url = nextflow_bin_url(first_release, get_all)
|
||||
t.notThrows(() => new URL(url))
|
||||
})
|
||||
|
||||
test("Nextflow binary URL valid", binary_url_macro, false)
|
||||
test("Nextflow 'all' binary URL valid", binary_url_macro, true)
|
||||
|
|
Loading…
Reference in a new issue