forked from actions/setup-go
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/main' into feature/go-file-ver…
…sion * upstream/main: (47 commits) Fix Install on Windows is very slow (actions#393) Bump word-wrap from 1.2.3 to 1.2.4 Fix licensing for Semver 6.3.1 Rebuild after updating Semver Bump semver from 6.3.0 to 6.3.1 Bump tough-cookie and @azure/ms-rest-js (actions#392) Limit to Linux only Add imageOS to primaryKey Add note about YAML parsing versions (actions#382) Added a description that go-version should be specified as a string type (actions#367) Update action.yml (actions#379) Move eslint-plugin-node to dev dependencies Install eslint-plugin-node Update configuration files Bump @actions/cache dependency to v3.2.1 (actions#374) Update xml2js (actions#370) Fix glob bug in package.json scripts section (actions#359) update README fo v4 (actions#354) Update configuration files (actions#348) Add Go bin if go-version input is empty (actions#351) ...
- Loading branch information
Showing
51 changed files
with
11,964 additions
and
12,824 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Ignore list | ||
/* | ||
|
||
# Do not ignore these folders: | ||
!__tests__/ | ||
!src/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// This is a reusable configuration file copied from https://github.com/actions/reusable-workflows/tree/main/reusable-configurations. Please don't make changes to this file as it's the subject of an automatic update. | ||
module.exports = { | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:eslint-plugin-jest/recommended', | ||
'eslint-config-prettier' | ||
], | ||
parser: '@typescript-eslint/parser', | ||
plugins: ['@typescript-eslint', 'eslint-plugin-node', 'eslint-plugin-jest'], | ||
rules: { | ||
'@typescript-eslint/no-require-imports': 'error', | ||
'@typescript-eslint/no-non-null-assertion': 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/no-empty-function': 'off', | ||
'@typescript-eslint/ban-ts-comment': [ | ||
'error', | ||
{ | ||
'ts-ignore': 'allow-with-description' | ||
} | ||
], | ||
'no-console': 'error', | ||
'yoda': 'error', | ||
'prefer-const': [ | ||
'error', | ||
{ | ||
destructuring: 'all' | ||
} | ||
], | ||
'no-control-regex': 'off', | ||
'no-constant-condition': ['error', {checkLoops: false}], | ||
'node/no-extraneous-import': 'error' | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['**/*{test,spec}.ts'], | ||
rules: { | ||
'@typescript-eslint/no-unused-vars': 'off', | ||
'jest/no-standalone-expect': 'off', | ||
'jest/no-conditional-expect': 'off', | ||
'no-console': 'off', | ||
|
||
} | ||
} | ||
], | ||
env: { | ||
node: true, | ||
es6: true, | ||
'jest/globals': true | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
* text=auto | ||
* text=auto eol=lf | ||
.licenses/** -diff linguist-generated=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
blank_issues_enabled: false | ||
blank_issues_enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Basic validation | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- '**.md' | ||
pull_request: | ||
paths-ignore: | ||
- '**.md' | ||
|
||
jobs: | ||
call-basic-validation: | ||
name: Basic validation | ||
uses: actions/reusable-workflows/.github/workflows/basic-validation.yml@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: CodeQL analysis | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
schedule: | ||
- cron: '0 3 * * 0' | ||
|
||
jobs: | ||
call-codeQL-analysis: | ||
name: CodeQL analysis | ||
uses: actions/reusable-workflows/.github/workflows/codeql-analysis.yml@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
name: Release new action version | ||
|
||
on: | ||
release: | ||
types: [released] | ||
|
@@ -21,7 +22,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- name: Update the ${{ env.TAG_NAME }} tag | ||
uses: actions/[email protected].1 | ||
uses: actions/[email protected].2 | ||
with: | ||
source-tag: ${{ env.TAG_NAME }} | ||
slack-webhook: ${{ secrets.SLACK_WEBHOOK }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: Update configuration files | ||
|
||
on: | ||
schedule: | ||
- cron: '0 3 * * 0' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
call-update-configuration-files: | ||
name: Update configuration files | ||
uses: actions/reusable-workflows/.github/workflows/update-config-files.yml@main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
name: Validate Windows installation | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- '**.md' | ||
pull_request: | ||
paths-ignore: | ||
- '**.md' | ||
|
||
jobs: | ||
create-link-if-not-default: | ||
runs-on: windows-latest | ||
name: 'Validate if symlink is created' | ||
strategy: | ||
matrix: | ||
cache: [false, true] | ||
go: [1.20.1] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: 'Setup ${{ matrix.cache }}, cache: ${{ matrix.go }}' | ||
uses: ./ | ||
with: | ||
go-version: ${{ matrix.go }} | ||
cache: ${{ matrix.cache }} | ||
|
||
- name: 'Drive C: should have zero size link' | ||
run: | | ||
du -m -s 'C:\hostedtoolcache\windows\go\${{ matrix.go }}\x64' | ||
# make sure drive c: contains only a link | ||
size=$(du -m -s 'C:\hostedtoolcache\windows\go\${{ matrix.go }}\x64'|cut -f1 -d$'\t') | ||
if [ $size -ne 0 ];then | ||
echo 'Size of the link created on drive c: must be 0' | ||
exit 1 | ||
fi | ||
shell: bash | ||
|
||
# Drive D: is small, take care the action does not eat up the space | ||
- name: 'Drive D: space usage should be below 1G' | ||
run: | | ||
du -m -s 'D:\hostedtoolcache\windows\go\${{ matrix.go }}\x64' | ||
size=$(du -m -s 'D:\hostedtoolcache\windows\go\${{ matrix.go }}\x64'|cut -f1 -d$'\t') | ||
# make sure archive does not take lot of space | ||
if [ $size -gt 999 ];then | ||
echo 'Size of installed on drive d: go is too big'; | ||
exit 1 | ||
fi | ||
shell: bash | ||
|
||
# make sure the Go installation has not been changed to the end user | ||
- name: Test paths and environments | ||
run: | | ||
echo $PATH | ||
which go | ||
go version | ||
go env | ||
if [ $(which go) != '/c/hostedtoolcache/windows/go/${{ matrix.go }}/x64/bin/go' ];then | ||
echo 'which go should return "/c/hostedtoolcache/windows/go/${{ matrix.go }}/x64/bin/go"' | ||
exit 1 | ||
fi | ||
if [ $(go env GOROOT) != 'C:\hostedtoolcache\windows\go\${{ matrix.go }}\x64' ];then | ||
echo 'go env GOROOT should return "C:\hostedtoolcache\windows\go\${{ matrix.go }}\x64"' | ||
exit 1 | ||
fi | ||
shell: bash | ||
|
||
find-default-go: | ||
name: 'Find default go version' | ||
runs-on: windows-latest | ||
outputs: | ||
version: ${{ steps.goversion.outputs.version }} | ||
steps: | ||
- run: | | ||
version=`go env GOVERSION|sed s/^go//` | ||
echo "default go version: $version" | ||
echo "version=$version" >> "$GITHUB_OUTPUT" | ||
id: goversion | ||
shell: bash | ||
dont-create-link-if-default: | ||
name: 'Validate if symlink is not created for default go' | ||
runs-on: windows-latest | ||
needs: find-default-go | ||
strategy: | ||
matrix: | ||
cache: [false, true] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: 'Setup default go, cache: ${{ matrix.cache }}' | ||
uses: ./ | ||
with: | ||
go-version: ${{ needs.find-default-go.outputs.version }} | ||
cache: ${{ matrix.cache }} | ||
|
||
- name: 'Drive C: should have Go installation, cache: ${{ matrix.cache}}' | ||
run: | | ||
size=$(du -m -s 'C:\hostedtoolcache\windows\go\${{ needs.find-default-go.outputs.version }}\x64'|cut -f1 -d$'\t') | ||
if [ $size -eq 0 ];then | ||
echo 'Size of the hosted go installed on drive c: must be above zero' | ||
exit 1 | ||
fi | ||
shell: bash | ||
|
||
- name: 'Drive D: should not have Go installation, cache: ${{ matrix.cache}}' | ||
run: | | ||
if [ -e 'D:\hostedtoolcache\windows\go\${{ needs.find-default-go.outputs.version }}\x64' ];then | ||
echo 'D:\hostedtoolcache\windows\go\${{ needs.find-default-go.outputs.version }}\x64 should not exist for hosted version of go'; | ||
exit 1 | ||
fi | ||
shell: bash |
Oops, something went wrong.