Skip to content

DRAFT: Release workflows #49

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

Merged
merged 44 commits into from
Jan 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
d3b335f
ci: ignore test.yml workflow on release-* branches PRs #36
jankapunkt Oct 18, 2021
8c080ff
ci: add tests-release.yml workflow to test release-integrity
jankapunkt Oct 18, 2021
c6459b8
ci: add release.yml to release a new version to registries
jankapunkt Oct 18, 2021
f4fc33b
ci(tests): make coverage generate lcov.info file
jankapunkt Oct 26, 2021
02e0a4d
ci(tests): make coverage generate lcov.info file as well as html #36
jankapunkt Oct 26, 2021
ac7bb86
ci(tests): fix spelling in coverage test script #36
jankapunkt Oct 26, 2021
002e380
release: up semver and update changelog
HappyZombies Nov 4, 2021
ad45e44
Merge pull request #52 from node-oauth/release-4.1.0
jankapunkt Nov 5, 2021
485147f
Merge pull request #51 from node-oauth/release-4.1.0
HappyZombies Nov 10, 2021
0e8f864
Bump eslint from 8.0.0 to 8.2.0
dependabot[bot] Nov 10, 2021
55775b9
Bump sinon from 7.5.0 to 12.0.1
dependabot[bot] Nov 10, 2021
969ce6a
build(lint): update eslint rules to automatically fix es5 code #54
jankapunkt Nov 11, 2021
b67db9c
build(lint): auto-fix var to const/let via eslint #54
jankapunkt Nov 11, 2021
1f88d0e
build (core): move codebase to ES 6 #58
jankapunkt Nov 16, 2021
3302186
Merge pull request #56 from node-oauth/dependabot/npm_and_yarn/eslint…
HappyZombies Nov 16, 2021
2fd7b8f
Merge pull request #53 from node-oauth/dependabot/npm_and_yarn/sinon-…
HappyZombies Nov 16, 2021
e3aeff1
Add TS types
orgads Oct 10, 2021
8784aed
Merge pull request #6 from orgads/types
HappyZombies Nov 24, 2021
d991b14
Remove superfluous files from published package
orgads Oct 10, 2021
5f2b0bb
Merge pull request #7 from orgads/limit-files
HappyZombies Nov 25, 2021
eaa9d03
release: up semver and update changelog
HappyZombies Nov 27, 2021
2fa8a7f
release: add missing changelog
HappyZombies Nov 27, 2021
1b91ddc
Merge pull request #87 from node-oauth/release-4.1.1
HappyZombies Nov 28, 2021
4ca8032
fix(handlers): skip varcheck for state when allowEmptyState
jankapunkt Nov 29, 2021
52ee11d
Merge pull request #88 from node-oauth/release-4.1.1
HappyZombies Nov 29, 2021
3df52fd
supported custom validateRedirectUri
Dec 5, 2021
91f27f8
Supported state in case of denial
Dec 5, 2021
5824f79
feature(): Supported state in case of denialMerge pull request #99 fr…
jankapunkt Dec 10, 2021
aca48ce
fix(handlers): skip varcheck for state when allowEmptyState #89 #93
jankapunkt Dec 10, 2021
88ef515
added test for `validateRedirectUri`
jorenvandeweyer Dec 11, 2021
0a86e69
updated documentation
jorenvandeweyer Dec 11, 2021
98a9d19
better implementation of validateRedirectUri
jorenvandeweyer Dec 11, 2021
ff9a5d2
fixed misssing return statement in doc (#98)
FStefanni Dec 13, 2021
292774e
build(deps-dev): bump eslint from 8.2.0 to 8.4.1 (#102)
dependabot[bot] Dec 13, 2021
4ff1f07
added @node-oauth/formats module, removed is.js tests
jwerre Dec 13, 2021
10fe55d
feature(core): extract is.js into standalone package @node-oauth/form…
jankapunkt Dec 14, 2021
10bca68
Bump sinon from 11.1.2 to 12.0.1 (#74)
dependabot[bot] Dec 18, 2021
643e091
build(deps-dev): bump eslint from 8.2.0 to 8.4.1 (#106)
dependabot[bot] Dec 18, 2021
92bea82
Integration test password grant (#100)
jorenvandeweyer Dec 19, 2021
3a1e433
added warning in docs, added extra tests that actually use parameters
jorenvandeweyer Dec 19, 2021
29e081b
Merge branch 'development' into issue_89_4_482
jorenvandeweyer Dec 19, 2021
9fab017
feature(authorize): allow custom implementations of validateRedirectU…
jankapunkt Dec 20, 2021
7174693
Merge branch 'development' into ci-release-package
jankapunkt Jan 13, 2022
13aacce
feature(ci): release workflow only runs on non-draft pull requests
jankapunkt Jan 13, 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
7 changes: 7 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@
"no-console": [
"error"
],
"no-var": [
"error"
],
"prefer-const": ["error", {
"destructuring": "any",
"ignoreReadBeforeAssign": false
}],
"no-unused-vars": [
"error",
{
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Release

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 12
- run: npm ci
- run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
# we always publish targeting the lowest supported node version
node-version: 12
registry-url: 'https://registry.npmjs.org/'
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

publish-gpr:
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
# we always publish targeting the lowest supported node version
node-version: 12
registry-url: $registry-url(npm)
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
155 changes: 155 additions & 0 deletions .github/workflows/tests-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
name: Tests for Release

on:
push:
branches:
- release-* # all release-<version> branches
pull_request:
types: [review_requested, ready_for_review] # only non-draft PR
branches:
- release-* # all release-<version> branches


jobs:
# STEP 1 - NPM Audit

# Before we even test a thing we want to have a clean audit! Since this is
# sufficient to be done using the lowest node version, we can easily use
# a fixed one:

audit:
name: NPM Audit
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup node 12
uses: actions/setup-node@v1
with:
node-version: 12
- run: npm audit --production # no audit for dev dependencies

# STEP 2 - basic unit tests

# This is the standard unit tests as we do in the basic tests for every PR
unittest:
name: Basic unit tests
runs-on: ubuntu-latest
needs: [audit]
strategy:
matrix:
node: [12, 14, 16]
steps:
- name: Checkout ${{ matrix.node }}
uses: actions/checkout@v2

- name: Setup node ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- name: Cache dependencies ${{ matrix.node }}
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node }}

# for this workflow we also require npm audit to pass
- run: npm ci
- run: npm run test:coverage

# with the following action we enforce PRs to have a high coverage
# and ensure, changes are tested well enough so that coverage won't fail
- name: check coverage
uses: devmasx/coverage-check-action@v1.2.0
with:
type: lcov
result_path: coverage/lcov.info
min_coverage: 95
token: ${{github.token}}

# STEP 3 - Integration tests

# Since our release may affect several packages that depend on it we need to
# cover the closest ones, like adapters and examples.

integrationtests:
name: Extended integration tests
runs-on: ubuntu-latest
needs: [unittest]
strategy:
matrix:
node: [12, 14, 16]
steps:
# checkout this repo
- name: Checkout ${{ matrix.node }}
uses: actions/checkout@v2

# checkout express-adapter repo
- name: Checkout express-adapter ${{ matrix.node }}
uses: actions/checkout@v2
with:
repository: node-oauth/express-adapter
path: github/testing

# place checkout for other adapters here
- name: Setup node ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- name: Cache dependencies ${{ matrix.node }}
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.node }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node }}

# in order to test the adapter we need to use the current state
# we just cloned and install it as local dependency
- run: cd github/testing/express-adapter && npm ci
- run: cd github/testing/express-adapter && npm install ./
- run: cd github/testing/express-adapter && npm run tests

# todo repeat with other adapters

npmpubdry:
name: NPM Publish Dry-run
runs-on: ubuntu-latest
needs: [integrationtests]
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup node 12
uses: actions/setup-node@v1
with:
node-version: '12.x'
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm publish --dry-run
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

ghpubdry:
needs: [integrationtests]
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
# we always publish targeting the lowest supported node version
node-version: 12
registry-url: $registry-url(npm)
- run: npm ci
- run: npm publish --dry-run
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
60 changes: 17 additions & 43 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,21 @@
name: Test suite
name: Tests

# This workflow runs standard unit tests to ensure basic integrity and avoid
# regressions on pull-requests (and pushes)

on:
push:
branches:
- master # allthough master is push protected we still keep it
- master # allthough master is push protected we still keep it
- development
pull_request: # runs on all PR
pull_request: # runs on all PR
branches-ignore:
- release-* # on release we run an extended workflow so no need for this

jobs:
# ----------------------------------
# uncomment when a linter is added
# ----------------------------------

# lintjs:
# name: Javascript lint
# runs-on: ubuntu-latest
# steps:
# - name: checkout
# uses: actions/checkout@v2
#
# - name: setup node
# uses: actions/setup-node@v1
# with:
# node-version: '12.x'
#
# - name: cache dependencies
# uses: actions/cache@v1
# with:
# path: ~/.npm
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-node-
# - run: npm ci
# - run: npm run lint

unittest:
name: unit tests
runs-on: ubuntu-latest
# uncomment when a linter is added
# needs: [lintjs]
strategy:
matrix:
node: [12, 14, 16]
Expand All @@ -61,15 +38,12 @@ jobs:
- run: npm ci
- run: npm run test:coverage

# ----------------------------------
# uncomment when a linter is added
# ----------------------------------

# - name: check coverage
# uses: devmasx/coverage-check-action@v1.2.0
# with:
# type: lcov
# result_path: coverage/lcov.info
# min_coverage: 90
# token: ${{github.token}}

# with the following action we enforce PRs to have a high coverage
# and ensure, changes are tested well enough so that coverage won't fail
- name: check coverage
uses: devmasx/coverage-check-action@v1.2.0
with:
type: lcov
result_path: coverage/lcov.info
min_coverage: 95
token: ${{github.token}}
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
## Changelog

## 4.1.1

### Added
- Added TypeScript types
### Changed
- Removed extra files when someone npm installs.
- Upgrades all code from ES5 to ES6, where possible.

## 4.1.0
### Changed
* Bump dev dependencies to resolve vulnerabilities
* Replaced jshint with eslint along with should and chai
* Use sha256 when generating tokens

### Added
* Added markdown files to discuss coding rules, commit conventions, contributing guidelines, etc.

### Removed
* Removed lodash dependency
* Removed statuses package and use built in http.STATUS_CODES instead.

### 4.0.0
* Bump jshint from 2.12.0 to 2.13.0
* Bump jshint from 2.12.0 to 2.13.0
Expand Down
1 change: 1 addition & 0 deletions docs/model/overview.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Model functions used by the authorization code grant:
- :ref:`Model#saveAuthorizationCode`
- :ref:`Model#revokeAuthorizationCode`
- :ref:`Model#validateScope`
- :ref:`Model#validateRedirectUri`

--------

Expand Down
Loading