Add linters (#499)
This commit is contained in:
parent
0920706a19
commit
25b96bac99
3 changed files with 19 additions and 12 deletions
25
.github/workflows/test.yml
vendored
25
.github/workflows/test.yml
vendored
|
|
@ -47,14 +47,11 @@ jobs:
|
||||||
|
|
||||||
- uses: 'actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a' # ratchet:actions/setup-node@v4
|
- uses: 'actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a' # ratchet:actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '20.x'
|
node-version-file: 'package.json'
|
||||||
|
|
||||||
- name: 'npm build'
|
- name: 'npm build'
|
||||||
run: 'npm ci && npm run build'
|
run: 'npm ci && npm run build'
|
||||||
|
|
||||||
- name: 'npm lint'
|
|
||||||
run: 'npm run lint'
|
|
||||||
|
|
||||||
- name: 'npm test'
|
- name: 'npm test'
|
||||||
run: 'npm run test'
|
run: 'npm run test'
|
||||||
|
|
||||||
|
|
@ -63,7 +60,8 @@ jobs:
|
||||||
# Direct Workload Identity Federation
|
# Direct Workload Identity Federation
|
||||||
#
|
#
|
||||||
direct_workload_identity_federation:
|
direct_workload_identity_federation:
|
||||||
if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name }}
|
if: |-
|
||||||
|
${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name }}
|
||||||
name: 'direct_workload_identity_federation'
|
name: 'direct_workload_identity_federation'
|
||||||
runs-on: '${{ matrix.os }}'
|
runs-on: '${{ matrix.os }}'
|
||||||
strategy:
|
strategy:
|
||||||
|
|
@ -82,7 +80,7 @@ jobs:
|
||||||
|
|
||||||
- uses: 'actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a' # ratchet:actions/setup-node@v4
|
- uses: 'actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a' # ratchet:actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '20.x'
|
node-version-file: 'package.json'
|
||||||
|
|
||||||
- name: 'npm build'
|
- name: 'npm build'
|
||||||
run: 'npm ci && npm run build'
|
run: 'npm ci && npm run build'
|
||||||
|
|
@ -116,7 +114,8 @@ jobs:
|
||||||
# Workload Identity Federation through a Service Account
|
# Workload Identity Federation through a Service Account
|
||||||
#
|
#
|
||||||
workload_identity_federation_through_service_account:
|
workload_identity_federation_through_service_account:
|
||||||
if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name }}
|
if: |-
|
||||||
|
${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name }}
|
||||||
name: 'workload_identity_federation_through_service_account'
|
name: 'workload_identity_federation_through_service_account'
|
||||||
runs-on: '${{ matrix.os }}'
|
runs-on: '${{ matrix.os }}'
|
||||||
strategy:
|
strategy:
|
||||||
|
|
@ -135,7 +134,7 @@ jobs:
|
||||||
|
|
||||||
- uses: 'actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a' # ratchet:actions/setup-node@v4
|
- uses: 'actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a' # ratchet:actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '20.x'
|
node-version-file: 'package.json'
|
||||||
|
|
||||||
- name: 'npm build'
|
- name: 'npm build'
|
||||||
run: 'npm ci && npm run build'
|
run: 'npm ci && npm run build'
|
||||||
|
|
@ -187,7 +186,8 @@ jobs:
|
||||||
# Service Account Key JSON
|
# Service Account Key JSON
|
||||||
#
|
#
|
||||||
credentials_json:
|
credentials_json:
|
||||||
if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name }}
|
if: |-
|
||||||
|
${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name }}
|
||||||
name: 'credentials_json'
|
name: 'credentials_json'
|
||||||
runs-on: '${{ matrix.os }}'
|
runs-on: '${{ matrix.os }}'
|
||||||
strategy:
|
strategy:
|
||||||
|
|
@ -203,7 +203,7 @@ jobs:
|
||||||
|
|
||||||
- uses: 'actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a' # ratchet:actions/setup-node@v4
|
- uses: 'actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a' # ratchet:actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '20.x'
|
node-version-file: 'package.json'
|
||||||
|
|
||||||
- name: 'npm build'
|
- name: 'npm build'
|
||||||
run: 'npm ci && npm run build'
|
run: 'npm ci && npm run build'
|
||||||
|
|
@ -254,7 +254,8 @@ jobs:
|
||||||
# has permissions to read the file.
|
# has permissions to read the file.
|
||||||
#
|
#
|
||||||
docker:
|
docker:
|
||||||
if: ${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name }}
|
if: |-
|
||||||
|
${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name }}
|
||||||
name: 'docker'
|
name: 'docker'
|
||||||
runs-on: 'ubuntu-latest'
|
runs-on: 'ubuntu-latest'
|
||||||
strategy:
|
strategy:
|
||||||
|
|
@ -264,7 +265,7 @@ jobs:
|
||||||
|
|
||||||
- uses: 'actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a' # ratchet:actions/setup-node@v4
|
- uses: 'actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a' # ratchet:actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '20.x'
|
node-version-file: 'package.json'
|
||||||
|
|
||||||
- name: 'npm build'
|
- name: 'npm build'
|
||||||
run: 'npm ci && npm run build'
|
run: 'npm ci && npm run build'
|
||||||
|
|
|
||||||
|
|
@ -16,4 +16,6 @@ set -eEuo pipefail
|
||||||
FILES="$(node -e "process.stdout.write(require('node:fs').readdirSync('./', { recursive: true }).filter((e) => {return e.endsWith('.test.ts') && !e.startsWith('node_modules');}).sort().join(' '));")"
|
FILES="$(node -e "process.stdout.write(require('node:fs').readdirSync('./', { recursive: true }).filter((e) => {return e.endsWith('.test.ts') && !e.startsWith('node_modules');}).sort().join(' '));")"
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
|
# shellcheck disable=SC2086
|
||||||
exec node --require ts-node/register --test-reporter spec --test ${FILES}
|
exec node --require ts-node/register --test-reporter spec --test ${FILES}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,10 @@
|
||||||
"format": "eslint . --fix",
|
"format": "eslint . --fix",
|
||||||
"test": "bash ./bin/runTests.sh"
|
"test": "bash ./bin/runTests.sh"
|
||||||
},
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "20.x",
|
||||||
|
"npm": "10.x"
|
||||||
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/google-github-actions/auth"
|
"url": "https://github.com/google-github-actions/auth"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue