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 #6

Merged
merged 41 commits into from
Nov 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
a101a06
docs: Update path
edmundmiller Nov 11, 2022
d9e8494
docs: Add note about why this is a complicated action
edmundmiller Nov 13, 2022
a8fabd1
chore: Update license to MIT and nf-core
edmundmiller Nov 13, 2022
7e278b3
chore: Update author
edmundmiller Nov 13, 2022
e52964f
build: Add ncc
edmundmiller Nov 13, 2022
8f74997
build: Add types
edmundmiller Nov 13, 2022
0484a72
build: Add eslint and prettier
edmundmiller Nov 13, 2022
719c409
style: Run prettier
edmundmiller Nov 13, 2022
521cabb
chore: Update package.json
edmundmiller Nov 13, 2022
ff741c2
refactor: Move everything into a src/ dir
edmundmiller Nov 13, 2022
9fec9e9
build: npm init ava
edmundmiller Nov 13, 2022
cc34899
build: Setup typescript tests
edmundmiller Nov 13, 2022
c1264da
refactor: Move functions functions to their own file
edmundmiller Nov 13, 2022
5a8602d
style: Set sort-imports to warn
edmundmiller Nov 13, 2022
1b48da1
style: Run prettier on everything
edmundmiller Nov 13, 2022
2cbd3ba
build: Add lint:fix script
edmundmiller Nov 13, 2022
5e0b6ea
build: Add eslint-plugin-ava
edmundmiller Nov 13, 2022
87f0df0
test: Add initial check for all_nf_releases
edmundmiller Nov 13, 2022
637da7b
test: Add test for latest_stable_release_data
edmundmiller Nov 13, 2022
c578c07
test: Add basic call for release_data
edmundmiller Nov 13, 2022
9d45937
style: Fix all eslint errors
edmundmiller Nov 13, 2022
50b4ba5
ci: Split up steps
edmundmiller Nov 13, 2022
9e591f3
style: format-check => format:check
edmundmiller Nov 13, 2022
8c70d2d
build: Update scripts to be more selective on files
edmundmiller Nov 13, 2022
256093c
test: Remove main test for now
edmundmiller Nov 13, 2022
a58ccac
ci: Update hoops to jump through
edmundmiller Nov 13, 2022
6106a78
chore: Remove eslint failure for ava import
edmundmiller Nov 13, 2022
720c227
build: lib => lib/src
edmundmiller Nov 13, 2022
cc23698
ci: Add build step
edmundmiller Nov 13, 2022
242955b
chore: Clean up some catch errors
edmundmiller Nov 13, 2022
bb2cf8d
chore: Clean up a bunch of object references
edmundmiller Nov 13, 2022
a25d163
chore: handle octokit typing
edmundmiller Nov 14, 2022
495b2b0
test: Write tests for release_data function
edmundmiller Nov 14, 2022
8ea4c94
chore: Clean up release sorting types
edmundmiller Nov 14, 2022
736568d
chore: Clean up typing in tests
edmundmiller Nov 14, 2022
8371f0b
style: Set bracketSpacing to true
edmundmiller Nov 14, 2022
9659d1e
style: Add simple-import-sort and run
edmundmiller Nov 14, 2022
0b7516b
test: Add main test from template
edmundmiller Nov 14, 2022
3aa9207
ci: Create seperate dev workflow checks
edmundmiller Nov 14, 2022
814348c
ci: Don't double run jobs
edmundmiller Nov 14, 2022
2138b34
style: Use double-quotes
edmundmiller Nov 15, 2022
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
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist/
lib/
node_modules/
63 changes: 63 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"plugins": ["ava", "@typescript-eslint", "simple-import-sort"],
"extends": ["plugin:github/recommended", "plugin:ava/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 9,
"sourceType": "module",
"project": "./tsconfig.json"
},
"rules": {
"simple-import-sort/imports": "error",
"simple-import-sort/exports": "error",
"i18n-text/no-en": "off",
"eslint-comments/no-use": "off",
"import/no-namespace": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/explicit-member-accessibility": [
"error",
{ "accessibility": "no-public" }
],
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-ts-comment": "error",
"camelcase": "off",
"@typescript-eslint/consistent-type-assertions": "error",
"@typescript-eslint/explicit-function-return-type": [
"error",
{ "allowExpressions": true }
],
"@typescript-eslint/func-call-spacing": ["error", "never"],
"@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-extraneous-class": "error",
"@typescript-eslint/no-for-in-array": "error",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/no-unnecessary-qualifier": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-function-type": "warn",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/require-array-sort-compare": "error",
"@typescript-eslint/restrict-plus-operands": "error",
"semi": "off",
"sort-imports": "off",
"@typescript-eslint/semi": ["error", "never"],
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unbound-method": "error"
},
"env": {
"node": true,
"es6": true
}
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/** -diff linguist-generated=true
9 changes: 7 additions & 2 deletions .github/workflows/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ name: Example builds

on:
push:
branches:
- master
pull_request:
workflow_dispatch:
release:
types: [published]

jobs:
test:
Expand All @@ -30,8 +34,9 @@ jobs:
with:
node-version: 16
cache: "npm"
- run: npm i -g @vercel/ncc
- run: npm ci && npm run build
- run: npm ci
- run: npm run build
- run: npm run package
- uses: ./
with:
version: ${{ matrix.nextflow_version }}
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ jobs:
with:
node-version: 16
cache: "npm"
- run: npm i -g @vercel/ncc
- run: npm ci && npm run build
- run: npm ci
- run: npm run build
- run: npm run package
- uses: JasonEtco/build-and-tag-action@v1
env:
GITHUB_TOKEN: ${{ github.token }}
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Run tests

on:
push:
branches:
- master
pull_request:
workflow_dispatch:
release:
types: [published]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
cache: "npm"
- run: npm ci
- run: npm run build
- run: npm run format:check
- run: npm run lint
- run: npm run package
# FIXME Token doesn't get passed correctly
# - run: npm run test
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,7 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# Ignore built ts files
__tests__/runner/*
lib/**/*
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist/
lib/
node_modules/
10 changes: 10 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"singleQuote": false,
"trailingComma": "none",
"bracketSpacing": true,
"arrowParens": "avoid"
}
10 changes: 5 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,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/MillironX/setup-nextflow/compare/v1.2.0...HEAD
[1.2.0]: https://github.com/MillironX/setup-nextflow/compare/v1.1.1...v1.2.0
[1.1.0]: https://github.com/MillironX/setup-nextflow/compare/v1.0.1...v1.1.0
[1.0.1]: https://github.com/MillironX/setup-nextflow/compare/v1.0.0...v1.0.1
[1.0.0]: https://github.com/MillironX/setup-nextflow/releases/tag/v1.0.0
[unreleased]: https://github.com/nf-core/setup-nextflow/compare/v1.2.0...HEAD
[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.0.1]: https://github.com/nf-core/setup-nextflow/compare/v1.0.0...v1.0.1
[1.0.0]: https://github.com/nf-core/setup-nextflow/releases/tag/v1.0.0
22 changes: 18 additions & 4 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
Copyright 2022 Thomas A. Christensen II
MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Copyright (c) 2022 nf-core

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
25 changes: 21 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Setup Nextflow for GitHub Actions

[![Testing](https://github.com/MillironX/setup-nextflow/actions/workflows/example.yml/badge.svg)](https://github.com/MillironX/setup-nextflow/actions/workflows/example.yml)
[![MIT License](https://img.shields.io/github/license/MillironX/setup-nextflow?logo=opensourceinitiative)](https://github.com/MillironX/setup-nextflow/blob/master/LICENSE)
[![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/MillironX/setup-nextflow?logo=github)](https://github.com/MillironX/setup-nextflow/releases/latest)
[![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)
[![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)

An action to install [Nextflow](https://nextflow.io) into a GitHub Actions workflow and make it available for subsequent steps.
Expand All @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: MillironX/setup-nextflow@v1
- uses: nf-core/setup-nextflow@v1.2.0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the nextflow-io org would actually be the ideal home for this action?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, not my department though! @ewels

- run: nextflow run ${GITHUB_WORKSPACE}
```

Expand Down Expand Up @@ -73,3 +73,20 @@ This action locates the releases based upon the GitHub API, and requires an acce
## Outputs

There are no outputs from this action.

## Why was this action made?

[Slack link](https://nfcore.slack.com/archives/CE56GDKN0/p1655210460795839)

You may be asking, why not just a few yaml lines?

```yaml
- name: Install Nextflow
env:
NXF_VER: ${{ matrix.NXF_VER }}
run: |
wget -qO- get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/
```

The versioning. From the Nextflow install script you can't get `latest-edge` or `latest-everything` for example.
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "Setup Nextflow"
description: "Install Nextflow and add it to the PATH"
author: "Thomas A. Christensen II"
author: "nf-core"
inputs:
version:
description: "The Nextflow version to download (if necessary) and use. Example: 21.10.3"
Expand Down
Loading