Merge branch 'master' into releases/v1

* master:
  Extend timeout for Jest tests
  Update dependencies with vulnerabilities
  ci: install node v16 instead of v12
  Bump ansi-regex from 5.0.0 to 5.0.1
  Update check-dist to run against master
  Create check-dist.yml
  fix: bump up nodejs to v16
  Bump tmpl from 1.0.4 to 1.0.5
  Bump path-parse from 1.0.6 to 1.0.7
  Pin glob-parent >= vulnerability fix
  Update @actions/core to 1.4.0
  Update dev dependencies
  chore: update metadata in package.json
  test: bump up Jest to v27 introducing new defaults
  build: bump up ncc to the latest ver
  Update RELEASING.md
This commit is contained in:
Daz DeBoer 2022-10-24 10:27:44 -06:00
commit f232d2e93f
No known key found for this signature in database
GPG key ID: DD6B9F0B06683D5D
13 changed files with 14170 additions and 7469 deletions

55
.github/workflows/check-dist.yml vendored Normal file
View file

@ -0,0 +1,55 @@
# `dist/index.js` is a special file in Actions.
# When you reference an action with `uses:` in a workflow,
# `index.js` is the code that will run.
# For our project, we generate this file through a build process from other source files.
# We need to make sure the checked-in `index.js` actually matches what we expect it to be.
name: Check dist/
on:
push:
branches:
- main
- master
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
workflow_dispatch:
jobs:
check-dist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set Node.js 16.x
uses: actions/setup-node@v2.4.1
with:
node-version: 16.x
- name: Validate package-lock
run: npx lockfile-lint --path package-lock.json --allowed-hosts npm yarn --validate-https
- name: Install dependencies
run: npm ci
- name: Rebuild the dist/ directory
run: npm run build
- name: Compare the expected and actual dist/ directories
run: |
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
id: diff
# If index.js was different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@v2
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist
path: dist/

View file

@ -1,6 +1,7 @@
# Release
* starting on `master`
* `npm install`
* `npm run all`
* `git checkout releases/v1`
* `git merge master`

View file

@ -1,5 +1,8 @@
import * as checksums from '../src/checksums'
import nock from 'nock'
import {afterEach, describe, expect, test, jest} from '@jest/globals'
jest.setTimeout(30000)
test('fetches wrapper jars checksums', async () => {
const validChecksums = await checksums.fetchValidChecksums(false)

View file

@ -1,5 +1,6 @@
import * as path from 'path'
import * as find from '../src/find'
import {expect, test} from '@jest/globals'
test('finds test data wrapper jars', async () => {
const repoRoot = path.resolve('.')

View file

@ -1,5 +1,6 @@
import * as path from 'path'
import * as hash from '../src/hash'
import {expect, test} from '@jest/globals'
test('can sha256 files', async () => {
const sha = await hash.sha256File(

View file

@ -1,5 +1,8 @@
import * as path from 'path'
import * as validate from '../src/validate'
import {expect, test, jest} from '@jest/globals'
jest.setTimeout(30000)
const baseDir = path.resolve('.')

View file

@ -17,7 +17,7 @@ inputs:
default: ''
runs:
using: 'node12'
using: 'node16'
main: 'dist/index.js'
branding:

8053
dist/index.js vendored

File diff suppressed because one or more lines are too long

View file

@ -1,12 +1,8 @@
module.exports = {
clearMocks: true,
moduleFileExtensions: ['js', 'ts', 'json'],
testEnvironment: 'node',
testMatch: ['**/*.test.ts'],
testRunner: 'jest-circus/runner',
transform: {
'^.+\\.ts$': 'ts-jest'
},
preset: 'ts-jest',
verbose: true,
setupFilesAfterEnv: ['./jest.setup.js']
}

13469
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -1,8 +1,8 @@
{
"name": "typescript-action",
"name": "wrapper-validation-action",
"version": "0.0.0",
"private": true,
"description": "TypeScript template action",
"description": "Gradle Wrapper Validation Action",
"main": "lib/main.js",
"scripts": {
"build": "tsc",
@ -15,34 +15,33 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/actions/typescript-action.git"
"url": "git+https://github.com/gradle/wrapper-validation-action.git"
},
"keywords": [
"actions",
"node",
"setup"
],
"author": "YourNameOrOrganization",
"author": "Gradle Inc.",
"license": "MIT",
"dependencies": {
"@actions/core": "1.2.6",
"@actions/core": "1.10.0",
"typed-rest-client": "1.8.4",
"unhomoglyph": "1.0.6"
},
"devDependencies": {
"@types/jest": "26.0.14",
"@types/node": "12.12.62",
"@typescript-eslint/parser": "4.2.0",
"@zeit/ncc": "0.22.3",
"eslint": "7.9.0",
"eslint-plugin-github": "4.1.1",
"eslint-plugin-jest": "24.0.2",
"jest": "26.4.2",
"jest-circus": "26.4.2",
"js-yaml": "3.14.0",
"nock": "^13.0.11",
"prettier": "2.1.2",
"ts-jest": "26.4.0",
"typescript": "4.0.3"
"@types/node": "12.20.16",
"@typescript-eslint/parser": "5.8.0",
"@vercel/ncc": "0.29.0",
"eslint": "8.5.0",
"eslint-plugin-github": "4.3.5",
"eslint-plugin-jest": "25.3.0",
"glob-parent": ">=5.1.2",
"jest": "27.0.6",
"js-yaml": "4.1.0",
"nock": "13.1.1",
"prettier": "2.3.2",
"ts-jest": "27.0.4",
"typescript": "4.5.4"
}
}

View file

@ -19,7 +19,11 @@ export async function run(): Promise<void> {
)
}
} catch (error) {
core.setFailed(error.message)
if (error instanceof Error) {
core.setFailed(error.message)
} else {
core.setFailed(`Unknown object was thrown: ${error}`)
}
}
}

View file

@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"target": "ES2021", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
"outDir": "./lib", /* Redirect output structure to the directory. */
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */