Vidya reddy pretty code (#53)
* updated action file with node16 * Code consistency using prettier and its workflow * Enforce Prettier * code fix * code fix * code fix Co-authored-by: Vidya Reddy <vidyareddy@microsoft.com>
This commit is contained in:
52
.github/workflows/default-labels.yml
vendored
52
.github/workflows/default-labels.yml
vendored
@ -2,34 +2,34 @@ name: Setting Default Labels
|
||||
|
||||
# Controls when the action will run.
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0/3 * * *"
|
||||
schedule:
|
||||
- cron: '0 0/3 * * *'
|
||||
|
||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||
jobs:
|
||||
build:
|
||||
# The type of runner that the job will run on
|
||||
runs-on: ubuntu-latest
|
||||
build:
|
||||
# The type of runner that the job will run on
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||
steps:
|
||||
- uses: actions/stale@v3
|
||||
name: Setting Issue as Idle
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-issue-message: "This issue is idle because it has been open for 14 days with no activity."
|
||||
stale-issue-label: "idle"
|
||||
days-before-stale: 14
|
||||
days-before-close: -1
|
||||
operations-per-run: 100
|
||||
exempt-issue-labels: "backlog"
|
||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||
steps:
|
||||
- uses: actions/stale@v3
|
||||
name: Setting Issue as Idle
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-issue-message: 'This issue is idle because it has been open for 14 days with no activity.'
|
||||
stale-issue-label: 'idle'
|
||||
days-before-stale: 14
|
||||
days-before-close: -1
|
||||
operations-per-run: 100
|
||||
exempt-issue-labels: 'backlog'
|
||||
|
||||
- uses: actions/stale@v3
|
||||
name: Setting PR as Idle
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-pr-message: "This PR is idle because it has been open for 14 days with no activity."
|
||||
stale-pr-label: "idle"
|
||||
days-before-stale: 14
|
||||
days-before-close: -1
|
||||
operations-per-run: 100
|
||||
- uses: actions/stale@v3
|
||||
name: Setting PR as Idle
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
stale-pr-message: 'This PR is idle because it has been open for 14 days with no activity.'
|
||||
stale-pr-label: 'idle'
|
||||
days-before-stale: 14
|
||||
days-before-close: -1
|
||||
operations-per-run: 100
|
||||
|
278
.github/workflows/integration-tests.yml
vendored
278
.github/workflows/integration-tests.yml
vendored
@ -1,143 +1,143 @@
|
||||
name: Run Integration Tests
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- "releases/*"
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- "releases/*"
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- 'releases/*'
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- 'releases/*'
|
||||
|
||||
jobs:
|
||||
kubeconfig-method-integration-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Source Code
|
||||
id: checkout-code
|
||||
uses: actions/checkout@v2
|
||||
- name: Npm Install and Build
|
||||
id: npm-build
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
- name: Set Context
|
||||
uses: ./
|
||||
with:
|
||||
method: kubeconfig
|
||||
context: exp-scratch
|
||||
kubeconfig: |
|
||||
apiVersion: v1
|
||||
clusters:
|
||||
- cluster:
|
||||
certificate-authority: fake-ca-file
|
||||
server: https://1.2.3.4
|
||||
name: development
|
||||
- cluster:
|
||||
insecure-skip-tls-verify: true
|
||||
server: https://5.6.7.8
|
||||
name: scratch
|
||||
contexts:
|
||||
- context:
|
||||
cluster: development
|
||||
namespace: frontend
|
||||
user: developer
|
||||
name: dev-frontend
|
||||
- context:
|
||||
cluster: development
|
||||
namespace: storage
|
||||
user: developer
|
||||
name: dev-storage
|
||||
- context:
|
||||
cluster: scratch
|
||||
namespace: default
|
||||
user: experimenter
|
||||
name: exp-scratch
|
||||
current-context: ""
|
||||
kind: Config
|
||||
preferences: {}
|
||||
users:
|
||||
- name: developer
|
||||
user:
|
||||
client-certificate: fake-cert-file
|
||||
client-key: fake-key-file
|
||||
- name: experimenter
|
||||
user:
|
||||
password: some-password
|
||||
username: exp
|
||||
- name: Vertify Results
|
||||
run: |
|
||||
echo "$EXPECTED_KC" > /tmp/expected_kc.json
|
||||
DIFF=$(diff <(jq -S -c . $KUBECONFIG) <(jq -S -c . /tmp/expected_kc.json))
|
||||
if [ "$DIFF" != "" ]; then exit 1; else echo -e "Kubeconfig matches expected"; fi
|
||||
env:
|
||||
EXPECTED_KC: |
|
||||
{
|
||||
"apiVersion": "v1",
|
||||
"clusters": [
|
||||
{
|
||||
"cluster": {
|
||||
"certificate-authority": "fake-ca-file",
|
||||
"insecure-skip-tls-verify": false,
|
||||
"server": "https://1.2.3.4"
|
||||
},
|
||||
"name": "development"
|
||||
},
|
||||
{
|
||||
"cluster": {
|
||||
"insecure-skip-tls-verify": true,
|
||||
"server": "https://5.6.7.8"
|
||||
},
|
||||
"name": "scratch"
|
||||
}
|
||||
],
|
||||
"contexts": [
|
||||
{
|
||||
"context": {
|
||||
"cluster": "development",
|
||||
"name": "dev-frontend",
|
||||
"namespace": "frontend",
|
||||
"user": "developer"
|
||||
},
|
||||
"name": "dev-frontend"
|
||||
},
|
||||
{
|
||||
"context": {
|
||||
"cluster": "development",
|
||||
"name": "dev-storage",
|
||||
"namespace": "storage",
|
||||
"user": "developer"
|
||||
},
|
||||
"name": "dev-storage"
|
||||
},
|
||||
{
|
||||
"context": {
|
||||
"cluster": "scratch",
|
||||
"name": "exp-scratch",
|
||||
"namespace": "default",
|
||||
"user": "experimenter"
|
||||
},
|
||||
"name": "exp-scratch"
|
||||
}
|
||||
],
|
||||
"current-context": "exp-scratch",
|
||||
"kind": "Config",
|
||||
"preferences": {
|
||||
},
|
||||
"users": [
|
||||
{
|
||||
"name": "developer",
|
||||
"user": {
|
||||
"client-certificate": "fake-cert-file",
|
||||
"client-key": "fake-key-file"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "experimenter",
|
||||
"user": {
|
||||
"password": "some-password",
|
||||
"username": "exp"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
kubeconfig-method-integration-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Source Code
|
||||
id: checkout-code
|
||||
uses: actions/checkout@v2
|
||||
- name: Npm Install and Build
|
||||
id: npm-build
|
||||
run: |
|
||||
npm install
|
||||
npm run build
|
||||
- name: Set Context
|
||||
uses: ./
|
||||
with:
|
||||
method: kubeconfig
|
||||
context: exp-scratch
|
||||
kubeconfig: |
|
||||
apiVersion: v1
|
||||
clusters:
|
||||
- cluster:
|
||||
certificate-authority: fake-ca-file
|
||||
server: https://1.2.3.4
|
||||
name: development
|
||||
- cluster:
|
||||
insecure-skip-tls-verify: true
|
||||
server: https://5.6.7.8
|
||||
name: scratch
|
||||
contexts:
|
||||
- context:
|
||||
cluster: development
|
||||
namespace: frontend
|
||||
user: developer
|
||||
name: dev-frontend
|
||||
- context:
|
||||
cluster: development
|
||||
namespace: storage
|
||||
user: developer
|
||||
name: dev-storage
|
||||
- context:
|
||||
cluster: scratch
|
||||
namespace: default
|
||||
user: experimenter
|
||||
name: exp-scratch
|
||||
current-context: ""
|
||||
kind: Config
|
||||
preferences: {}
|
||||
users:
|
||||
- name: developer
|
||||
user:
|
||||
client-certificate: fake-cert-file
|
||||
client-key: fake-key-file
|
||||
- name: experimenter
|
||||
user:
|
||||
password: some-password
|
||||
username: exp
|
||||
- name: Vertify Results
|
||||
run: |
|
||||
echo "$EXPECTED_KC" > /tmp/expected_kc.json
|
||||
DIFF=$(diff <(jq -S -c . $KUBECONFIG) <(jq -S -c . /tmp/expected_kc.json))
|
||||
if [ "$DIFF" != "" ]; then exit 1; else echo -e "Kubeconfig matches expected"; fi
|
||||
env:
|
||||
EXPECTED_KC: |
|
||||
{
|
||||
"apiVersion": "v1",
|
||||
"clusters": [
|
||||
{
|
||||
"cluster": {
|
||||
"certificate-authority": "fake-ca-file",
|
||||
"insecure-skip-tls-verify": false,
|
||||
"server": "https://1.2.3.4"
|
||||
},
|
||||
"name": "development"
|
||||
},
|
||||
{
|
||||
"cluster": {
|
||||
"insecure-skip-tls-verify": true,
|
||||
"server": "https://5.6.7.8"
|
||||
},
|
||||
"name": "scratch"
|
||||
}
|
||||
],
|
||||
"contexts": [
|
||||
{
|
||||
"context": {
|
||||
"cluster": "development",
|
||||
"name": "dev-frontend",
|
||||
"namespace": "frontend",
|
||||
"user": "developer"
|
||||
},
|
||||
"name": "dev-frontend"
|
||||
},
|
||||
{
|
||||
"context": {
|
||||
"cluster": "development",
|
||||
"name": "dev-storage",
|
||||
"namespace": "storage",
|
||||
"user": "developer"
|
||||
},
|
||||
"name": "dev-storage"
|
||||
},
|
||||
{
|
||||
"context": {
|
||||
"cluster": "scratch",
|
||||
"name": "exp-scratch",
|
||||
"namespace": "default",
|
||||
"user": "experimenter"
|
||||
},
|
||||
"name": "exp-scratch"
|
||||
}
|
||||
],
|
||||
"current-context": "exp-scratch",
|
||||
"kind": "Config",
|
||||
"preferences": {
|
||||
},
|
||||
"users": [
|
||||
{
|
||||
"name": "developer",
|
||||
"user": {
|
||||
"client-certificate": "fake-cert-file",
|
||||
"client-key": "fake-key-file"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "experimenter",
|
||||
"user": {
|
||||
"password": "some-password",
|
||||
"username": "exp"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
18
.github/workflows/prettify-code.yml
vendored
Normal file
18
.github/workflows/prettify-code.yml
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
name: 'Run prettify'
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
prettier:
|
||||
name: Prettier Check
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Enforce Prettier
|
||||
uses: actionsx/prettier@v2
|
||||
with:
|
||||
args: --check .
|
18
.github/workflows/release-pr.yml
vendored
18
.github/workflows/release-pr.yml
vendored
@ -1,14 +1,14 @@
|
||||
name: Create release PR
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
release:
|
||||
description: "Define release version (ex: v1, v2, v3)"
|
||||
required: true
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
release:
|
||||
description: 'Define release version (ex: v1, v2, v3)'
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
release-pr:
|
||||
uses: OliverMKing/javascript-release-workflow/.github/workflows/release-pr.yml@main
|
||||
with:
|
||||
release: ${{ github.event.inputs.release }}
|
||||
release-pr:
|
||||
uses: OliverMKing/javascript-release-workflow/.github/workflows/release-pr.yml@main
|
||||
with:
|
||||
release: ${{ github.event.inputs.release }}
|
||||
|
10
.github/workflows/tag-and-draft.yml
vendored
10
.github/workflows/tag-and-draft.yml
vendored
@ -1,10 +1,10 @@
|
||||
name: Tag and create release draft
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- releases/*
|
||||
push:
|
||||
branches:
|
||||
- releases/*
|
||||
|
||||
jobs:
|
||||
tag-and-release:
|
||||
uses: OliverMKing/javascript-release-workflow/.github/workflows/tag-and-release.yml@main
|
||||
tag-and-release:
|
||||
uses: OliverMKing/javascript-release-workflow/.github/workflows/tag-and-release.yml@main
|
||||
|
32
.github/workflows/unit-tests.yml
vendored
32
.github/workflows/unit-tests.yml
vendored
@ -1,20 +1,20 @@
|
||||
name: Run Unit Tests
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- "releases/*"
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- "releases/*"
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- 'releases/*'
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- 'releases/*'
|
||||
|
||||
jobs:
|
||||
unit-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Run Unit Tests
|
||||
run: |
|
||||
npm install
|
||||
npm test
|
||||
unit-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Run Unit Tests
|
||||
run: |
|
||||
npm install
|
||||
npm test
|
||||
|
Reference in New Issue
Block a user