Merged with parent main

This commit is contained in:
Sergey-Murtazin 2021-12-19 03:22:20 +03:00
commit e461af0410
10 changed files with 136 additions and 50 deletions

38
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View file

@ -0,0 +1,38 @@
---
name: Bug report
about: Create a bug report
title: ''
labels: bug, needs triage
assignees: ''
---
<!--- Please direct any generic questions related to actions to our support community forum at https://github.community/c/code-to-cloud/github-actions/41 --->
<!--- Before opening up a new bug report, please make sure to check for similar existing issues -->
**Description:**
A clear and concise description of what the bug is.
**Action version:**
Specify the action version
**Platform:**
- [ ] Ubuntu
- [ ] macOS
- [ ] Windows
**Runner type:**
- [ ] Hosted
- [ ] Self-hosted
**Tools version:**
<!--- Please specify go version -->
**Repro steps:**
A description with steps to reproduce the issue. If your have a public example or repo to share, please provide the link.
**Expected behavior:**
A description of what you expected to happen.
**Actual behavior:**
A description of what is actually happening.

1
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View file

@ -0,0 +1 @@
blank_issues_enabled: false

View file

@ -0,0 +1,18 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: feature request, needs triage
assignees: ''
---
<!--- Please direct any generic questions related to actions to our support community forum at https://github.community/c/code-to-cloud/github-actions/41 --->
<!--- Before opening up a new feature request, please make sure to check for similar existing issues and pull requests -->
**Description:**
Describe your proposal.
**Justification:**
Justification or a use case for your proposal.
**Are you willing to submit a PR?**
<!--- We accept contributions! -->

9
.github/pull_request_template.md vendored Normal file
View file

@ -0,0 +1,9 @@
**Description:**
Describe your changes.
**Related issue:**
Add link to the related issue.
**Check list:**
- [ ] Mark if documentation changes are required.
- [ ] Mark if tests were added or updated to cover the changes.

View file

@ -20,8 +20,8 @@ jobs:
name: releaseNewActionVersion name: releaseNewActionVersion
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Update the ${{ env.TAG_NAME }} tag - name: Update the ${{ env.TAG_NAME }} tag
uses: actions/publish-action@v0.1.0 uses: actions/publish-action@v0.1.0
with: with:
source-tag: ${{ env.TAG_NAME }} source-tag: ${{ env.TAG_NAME }}
slack-webhook: ${{ secrets.SLACK_WEBHOOK }} slack-webhook: ${{ secrets.SLACK_WEBHOOK }}

View file

@ -63,12 +63,14 @@ jobs:
os: [macos-latest, windows-latest, ubuntu-latest] os: [macos-latest, windows-latest, ubuntu-latest]
go: [1.7, 1.8.6] go: [1.7, 1.8.6]
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: setup-go ${{ matrix.go }}
uses: ./ - name: setup-go ${{ matrix.go }}
with: uses: ./
go-version: ${{ matrix.go }} with:
- name: verify go go-version: ${{ matrix.go }}
run: __tests__/verify-go.sh ${{ matrix.go }}
shell: bash - name: verify go
run: __tests__/verify-go.sh ${{ matrix.go }}
shell: bash

View file

@ -16,23 +16,23 @@ jobs:
matrix: matrix:
operating-system: [ubuntu-latest, windows-latest] operating-system: [ubuntu-latest, windows-latest]
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Setup node 12 - name: Setup node 12
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:
node-version: 12 node-version: 12
- name: npm install - name: npm install
run: npm install run: npm install
- name: Lint - name: Lint
run: npm run format-check run: npm run format-check
- name: npm test - name: npm test
run: npm test run: npm test
- name: audit packages - name: audit packages
run: npm audit --audit-level=high run: npm audit --audit-level=high
if: matrix.operating-system == 'ubuntu-latest' if: matrix.operating-system == 'ubuntu-latest'

View file

@ -21,25 +21,25 @@ The V2 offers:
It will first check the local cache for a version match. If version is not found locally, It will pull it from `main` branch of [go-versions](https://github.com/actions/go-versions/blob/main/versions-manifest.json) repository and on miss or failure, it will fall back to the previous behavior of download directly from [go dist](https://storage.googleapis.com/golang). It will first check the local cache for a version match. If version is not found locally, It will pull it from `main` branch of [go-versions](https://github.com/actions/go-versions/blob/main/versions-manifest.json) repository and on miss or failure, it will fall back to the previous behavior of download directly from [go dist](https://storage.googleapis.com/golang).
Matching by semver spec: Matching by [semver spec](https://github.com/npm/node-semver):
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions/setup-go@v2 - uses: actions/setup-go@v2
with: with:
go-version: '^1.13.1' # The Go version to download (if necessary) and use. go-version: '^1.13.1' # The Go version to download (if necessary) and use.
- run: go version - run: go version
``` ```
Matching an unstable pre-release: Matching an unstable pre-release:
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: actions/setup-go@v2 - uses: actions/setup-go@v2
with: with:
stable: 'false' stable: 'false'
go-version: '1.14.0-rc1' # The Go version to download (if necessary) and use. go-version: '1.14.0-rc1' # The Go version to download (if necessary) and use.
- run: go version - run: go version
``` ```
# Usage # Usage
@ -49,11 +49,11 @@ See [action.yml](action.yml)
Basic: Basic:
```yaml ```yaml
steps: steps:
- uses: actions/checkout@master - uses: actions/checkout@master
- uses: actions/setup-go@v2 - uses: actions/setup-go@v2
with: with:
go-version: '1.9.3' # The Go version to download (if necessary) and use. go-version: '1.9.3' # The Go version to download (if necessary) and use.
- run: go run hello.go - run: go run hello.go
``` ```
Matrix Testing: Matrix Testing:
@ -74,15 +74,23 @@ jobs:
- run: go run hello.go - run: go run hello.go
``` ```
### Supported version syntax
The `go-version` input supports the following syntax:
Specific versions: `1.15`, `1.16.1`, `1.17.0-rc2`, `1.16.0-beta1`
SemVer's version range syntax: `^1.13.1`
For more information about semantic versioning please refer [semver](https://github.com/npm/node-semver) documentation
# Keep in mind: latest, cached go compilers and semver notation. # Keep in mind: latest, cached go compilers and semver notation.
The `setup-go` action doesn't install the latest matched version if the cached version matches one from WF file. The `setup-go` action doesn't install the latest matched version if the cached version matches one from WF file.
**For example:** **For example:**
Currently, there is three go compilers on [Ubuntu 20.04.3 LTS](https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md) virtual environment: `1.15.15`, `1.16.12`, `1.17.5`. Currently, there is three go compilers on [Ubuntu 20.04.3 LTS](https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md) virtual environment: `1.15.15`, `1.16.12`, `1.17.5`.
When the `1.17.6` version will be out and there is `1.17.*` in `go-version` field, the cached `1.17.5` version will be used. Not the new one. Until the cached version will be updated to the latest `1.17.6`. When the `1.17.6` version will be out and there is `1.17.*` in `go-version` field, the cached `1.17.5` version will be used. Not the new one. Until the cached version will be updated to the latest `1.17.6`.
If you will specify fully `1.17.6`, the default installation process begins. If you will specify fully `1.17.6`, the default installation process begins.
# License # License
The scripts and documentation in this project are released under the [MIT License](LICENSE) The scripts and documentation in this project are released under the [MIT License](LICENSE)

View file

@ -497,6 +497,16 @@ describe('setup-go', () => {
expect(annotation.message).toBe('undefined: fmt.Printl'); expect(annotation.message).toBe('undefined: fmt.Printl');
}); });
it('matches on unix path down the tree', async () => {
let line = 'foo/main.go:13:2: undefined: fmt.Printl';
let annotation = testMatch(line);
expect(annotation).toBeDefined();
expect(annotation.line).toBe(13);
expect(annotation.column).toBe(2);
expect(annotation.file).toBe('foo/main.go');
expect(annotation.message).toBe('undefined: fmt.Printl');
});
it('matches on rooted unix path', async () => { it('matches on rooted unix path', async () => {
let line = '/assert.go:4:1: missing return at end of function'; let line = '/assert.go:4:1: missing return at end of function';
let annotation = testMatch(line); let annotation = testMatch(line);

View file

@ -4,7 +4,7 @@
"owner": "go", "owner": "go",
"pattern": [ "pattern": [
{ {
"regexp": "^\\s*(\\.{0,2}[\\/\\\\].+\\.go):(?:(\\d+):(\\d+):)? (.*)", "regexp": "^\\s*(.+\\.go):(?:(\\d+):(\\d+):)? (.*)",
"file": 1, "file": 1,
"line": 2, "line": 2,
"column": 3, "column": 3,
@ -13,4 +13,4 @@
] ]
} }
] ]
} }