diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..aad6a0f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a bug report +title: '' +labels: bug, needs triage +assignees: '' + +--- + + + + +**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:** + + +**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. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..ec4bb38 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..1c37027 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,18 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: feature request, needs triage +assignees: '' +--- + + + +**Description:** +Describe your proposal. + +**Justification:** +Justification or a use case for your proposal. + +**Are you willing to submit a PR?** + \ No newline at end of file diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..ef54aca --- /dev/null +++ b/.github/pull_request_template.md @@ -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. \ No newline at end of file diff --git a/.github/workflows/release-new-action-version.yml b/.github/workflows/release-new-action-version.yml index 955ced7..797c81a 100644 --- a/.github/workflows/release-new-action-version.yml +++ b/.github/workflows/release-new-action-version.yml @@ -20,8 +20,8 @@ jobs: name: releaseNewActionVersion runs-on: ubuntu-latest steps: - - name: Update the ${{ env.TAG_NAME }} tag - uses: actions/publish-action@v0.1.0 - with: - source-tag: ${{ env.TAG_NAME }} - slack-webhook: ${{ secrets.SLACK_WEBHOOK }} \ No newline at end of file + - name: Update the ${{ env.TAG_NAME }} tag + uses: actions/publish-action@v0.1.0 + with: + source-tag: ${{ env.TAG_NAME }} + slack-webhook: ${{ secrets.SLACK_WEBHOOK }} diff --git a/.github/workflows/versions.yml b/.github/workflows/versions.yml index 6b6d5f9..33a5fc6 100644 --- a/.github/workflows/versions.yml +++ b/.github/workflows/versions.yml @@ -63,12 +63,14 @@ jobs: os: [macos-latest, windows-latest, ubuntu-latest] go: [1.7, 1.8.6] steps: - - name: Checkout - uses: actions/checkout@v2 - - name: setup-go ${{ matrix.go }} - uses: ./ - with: - go-version: ${{ matrix.go }} - - name: verify go - run: __tests__/verify-go.sh ${{ matrix.go }} - shell: bash + - name: Checkout + uses: actions/checkout@v2 + + - name: setup-go ${{ matrix.go }} + uses: ./ + with: + go-version: ${{ matrix.go }} + + - name: verify go + run: __tests__/verify-go.sh ${{ matrix.go }} + shell: bash diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 274f7e9..1126e0c 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -16,23 +16,23 @@ jobs: matrix: operating-system: [ubuntu-latest, windows-latest] steps: - - name: Checkout - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v2 - - name: Setup node 12 - uses: actions/setup-node@v1 - with: - node-version: 12 + - name: Setup node 12 + uses: actions/setup-node@v1 + with: + node-version: 12 - - name: npm install - run: npm install + - name: npm install + run: npm install - - name: Lint - run: npm run format-check + - name: Lint + run: npm run format-check - - name: npm test - run: npm test + - name: npm test + run: npm test - - name: audit packages - run: npm audit --audit-level=high - if: matrix.operating-system == 'ubuntu-latest' \ No newline at end of file + - name: audit packages + run: npm audit --audit-level=high + if: matrix.operating-system == 'ubuntu-latest' diff --git a/README.md b/README.md index 5198479..2fed43f 100644 --- a/README.md +++ b/README.md @@ -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). -Matching by semver spec: +Matching by [semver spec](https://github.com/npm/node-semver): ```yaml steps: -- uses: actions/checkout@v2 -- uses: actions/setup-go@v2 - with: - go-version: '^1.13.1' # The Go version to download (if necessary) and use. -- run: go version + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: '^1.13.1' # The Go version to download (if necessary) and use. + - run: go version ``` Matching an unstable pre-release: ```yaml steps: -- uses: actions/checkout@v2 -- uses: actions/setup-go@v2 - with: - stable: 'false' - go-version: '1.14.0-rc1' # The Go version to download (if necessary) and use. -- run: go version + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + stable: 'false' + go-version: '1.14.0-rc1' # The Go version to download (if necessary) and use. + - run: go version ``` # Usage @@ -49,11 +49,11 @@ See [action.yml](action.yml) Basic: ```yaml steps: -- uses: actions/checkout@master -- uses: actions/setup-go@v2 - with: - go-version: '1.9.3' # The Go version to download (if necessary) and use. -- run: go run hello.go + - uses: actions/checkout@master + - uses: actions/setup-go@v2 + with: + go-version: '1.9.3' # The Go version to download (if necessary) and use. + - run: go run hello.go ``` Matrix Testing: @@ -74,15 +74,23 @@ jobs: - 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. -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:** 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`. If you will specify fully `1.17.6`, the default installation process begins. - # License The scripts and documentation in this project are released under the [MIT License](LICENSE) diff --git a/__tests__/setup-go.test.ts b/__tests__/setup-go.test.ts index c90d74b..c113ccb 100644 --- a/__tests__/setup-go.test.ts +++ b/__tests__/setup-go.test.ts @@ -497,6 +497,16 @@ describe('setup-go', () => { 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 () => { let line = '/assert.go:4:1: missing return at end of function'; let annotation = testMatch(line); diff --git a/matchers.json b/matchers.json index 675fdb7..24be341 100644 --- a/matchers.json +++ b/matchers.json @@ -4,7 +4,7 @@ "owner": "go", "pattern": [ { - "regexp": "^\\s*(\\.{0,2}[\\/\\\\].+\\.go):(?:(\\d+):(\\d+):)? (.*)", + "regexp": "^\\s*(.+\\.go):(?:(\\d+):(\\d+):)? (.*)", "file": 1, "line": 2, "column": 3, @@ -13,4 +13,4 @@ ] } ] -} \ No newline at end of file +}