minor nit , upgrade helm and GH action version updates (#102)

This commit is contained in:
Ajay Kemparaj
2022-12-27 06:28:27 -08:00
committed by GitHub
parent a4617735aa
commit f77071b246
6 changed files with 17 additions and 20 deletions

View File

@ -13,7 +13,7 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job # Steps represent a sequence of tasks that will be executed as part of the job
steps: steps:
- uses: actions/stale@v3 - uses: actions/stale@v6
name: Setting issue as idle name: Setting issue as idle
with: with:
repo-token: ${{ secrets.GITHUB_TOKEN }} repo-token: ${{ secrets.GITHUB_TOKEN }}
@ -24,7 +24,7 @@ jobs:
operations-per-run: 100 operations-per-run: 100
exempt-issue-labels: 'backlog' exempt-issue-labels: 'backlog'
- uses: actions/stale@v3 - uses: actions/stale@v6
name: Setting PR as idle name: Setting PR as idle
with: with:
repo-token: ${{ secrets.GITHUB_TOKEN }} repo-token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -15,7 +15,7 @@ jobs:
PR_BASE_REF: ${{ github.event.pull_request.base.ref }} PR_BASE_REF: ${{ github.event.pull_request.base.ref }}
steps: steps:
- name: Check out repository - name: Check out repository
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: npm install and build - name: npm install and build
id: action-npm-build id: action-npm-build
run: | run: |

View File

@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout Repository - name: Checkout Repository
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Enforce Prettier - name: Enforce Prettier
uses: actionsx/prettier@v2 uses: actionsx/prettier@v2

View File

@ -13,7 +13,7 @@ jobs:
build: # make sure build/ci works properly build: # make sure build/ci works properly
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v3
- name: Run L0 tests. - name: Run L0 tests.
run: | run: |

View File

@ -23,19 +23,19 @@ describe('run.ts', () => {
test('getHelmDownloadURL() - return the URL to download helm for Linux', () => { test('getHelmDownloadURL() - return the URL to download helm for Linux', () => {
jest.spyOn(os, 'type').mockReturnValue('Linux') jest.spyOn(os, 'type').mockReturnValue('Linux')
jest.spyOn(os, 'arch').mockReturnValueOnce('unknown') jest.spyOn(os, 'arch').mockReturnValueOnce('unknown')
const kubectlLinuxUrl = 'https://get.helm.sh/helm-v3.8.0-linux-amd64.zip' const helmLinuxUrl = 'https://get.helm.sh/helm-v3.8.0-linux-amd64.zip'
expect(run.getHelmDownloadURL('v3.8.0')).toBe(kubectlLinuxUrl) expect(run.getHelmDownloadURL('v3.8.0')).toBe(helmLinuxUrl)
expect(os.type).toBeCalled() expect(os.type).toBeCalled()
expect(os.arch).toBeCalled() expect(os.arch).toBeCalled()
// arm64 // arm64
jest.spyOn(os, 'type').mockReturnValue('Linux') jest.spyOn(os, 'type').mockReturnValue('Linux')
jest.spyOn(os, 'arch').mockReturnValueOnce('arm64') jest.spyOn(os, 'arch').mockReturnValueOnce('arm64')
const kubectlLinuxArm64Url = const helmLinuxArm64Url =
'https://get.helm.sh/helm-v3.8.0-linux-arm64.zip' 'https://get.helm.sh/helm-v3.8.0-linux-arm64.zip'
expect(run.getHelmDownloadURL('v3.8.0')).toBe(kubectlLinuxArm64Url) expect(run.getHelmDownloadURL('v3.8.0')).toBe(helmLinuxArm64Url)
expect(os.type).toBeCalled() expect(os.type).toBeCalled()
expect(os.arch).toBeCalled() expect(os.arch).toBeCalled()
}) })
@ -43,20 +43,19 @@ describe('run.ts', () => {
test('getHelmDownloadURL() - return the URL to download helm for Darwin', () => { test('getHelmDownloadURL() - return the URL to download helm for Darwin', () => {
jest.spyOn(os, 'type').mockReturnValue('Darwin') jest.spyOn(os, 'type').mockReturnValue('Darwin')
jest.spyOn(os, 'arch').mockReturnValueOnce('unknown') jest.spyOn(os, 'arch').mockReturnValueOnce('unknown')
const kubectlDarwinUrl = const helmDarwinUrl = 'https://get.helm.sh/helm-v3.8.0-darwin-amd64.zip'
'https://get.helm.sh/helm-v3.8.0-darwin-amd64.zip'
expect(run.getHelmDownloadURL('v3.8.0')).toBe(kubectlDarwinUrl) expect(run.getHelmDownloadURL('v3.8.0')).toBe(helmDarwinUrl)
expect(os.type).toBeCalled() expect(os.type).toBeCalled()
expect(os.arch).toBeCalled() expect(os.arch).toBeCalled()
// arm64 // arm64
jest.spyOn(os, 'type').mockReturnValue('Darwin') jest.spyOn(os, 'type').mockReturnValue('Darwin')
jest.spyOn(os, 'arch').mockReturnValueOnce('arm64') jest.spyOn(os, 'arch').mockReturnValueOnce('arm64')
const kubectlDarwinArm64Url = const helmDarwinArm64Url =
'https://get.helm.sh/helm-v3.8.0-darwin-arm64.zip' 'https://get.helm.sh/helm-v3.8.0-darwin-arm64.zip'
expect(run.getHelmDownloadURL('v3.8.0')).toBe(kubectlDarwinArm64Url) expect(run.getHelmDownloadURL('v3.8.0')).toBe(helmDarwinArm64Url)
expect(os.type).toBeCalled() expect(os.type).toBeCalled()
expect(os.arch).toBeCalled() expect(os.arch).toBeCalled()
}) })
@ -68,14 +67,13 @@ describe('run.ts', () => {
test('getHelmDownloadURL() - return the URL to download helm for Windows', () => { test('getHelmDownloadURL() - return the URL to download helm for Windows', () => {
jest.spyOn(os, 'type').mockReturnValue('Windows_NT') jest.spyOn(os, 'type').mockReturnValue('Windows_NT')
const kubectlWindowsUrl = const helmWindowsUrl = 'https://get.helm.sh/helm-v3.8.0-windows-amd64.zip'
'https://get.helm.sh/helm-v3.8.0-windows-amd64.zip' expect(run.getHelmDownloadURL('v3.8.0')).toBe(helmWindowsUrl)
expect(run.getHelmDownloadURL('v3.8.0')).toBe(kubectlWindowsUrl)
expect(os.type).toBeCalled() expect(os.type).toBeCalled()
}) })
test('getLatestHelmVersion() - return the stable version of HELM since its not authenticated', async () => { test('getLatestHelmVersion() - return the stable version of HELM since its not authenticated', async () => {
expect(await run.getLatestHelmVersion()).toBe('v3.9.0') expect(await run.getLatestHelmVersion()).toBe('v3.10.2')
}) })
test('walkSync() - return path to the all files matching fileToFind in dir', () => { test('walkSync() - return path to the all files matching fileToFind in dir', () => {

View File

@ -11,10 +11,9 @@ import * as toolCache from '@actions/tool-cache'
import * as core from '@actions/core' import * as core from '@actions/core'
import {graphql} from '@octokit/graphql' import {graphql} from '@octokit/graphql'
import {createActionAuth} from '@octokit/auth-action' import {createActionAuth} from '@octokit/auth-action'
import {create} from 'domain'
const helmToolName = 'helm' const helmToolName = 'helm'
const stableHelmVersion = 'v3.9.0' const stableHelmVersion = 'v3.10.2'
export async function run() { export async function run() {
let version = core.getInput('version', {required: true}) let version = core.getInput('version', {required: true})