Skip to content

Commit

Permalink
test: add test for two old version format
Browse files Browse the repository at this point in the history
  • Loading branch information
wolf29f committed Sep 12, 2024
1 parent c7c810b commit 038953b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,12 @@ jobs:
run: |
test "${{ steps.selftest.outputs.go_version }}" == "1.22.0"
test "${{ steps.selftest.outputs.go_module }}" == "github.com/pawndev/go-modfile-information"
- name: Self test two digits format
id: selftest_two_digits
uses: ./
with:
modfile: tests/two-digits.go.mod
- name: Check outputs
run: |
test "${{ steps.selftest_two_digits.outputs.go_version }}" == "1.21"
test "${{ steps.selftest_two_digits.outputs.go_module }}" == "github.com/pawndev/go-modfile-information"
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ See the [examples](#examples) for how to use it

### Inputs

| Input | Description | Default value |
|-----------------------------|---------------------------------|---------------|
| `modfile` | An example mandatory input | go.mod |
| Input | Description | Default value |
| --------- | -------------------------- | ------------- |
| `modfile` | An example mandatory input | go.mod |

### Outputs

| Output | Description |
|--------------|--------------------------|
| ------------ | ------------------------ |
| `go_version` | Go version of the module |
| `go_module` | Go module name |

Expand Down Expand Up @@ -50,4 +50,6 @@ with:
## Testing locally
Be sure to have [act](https://github.com/nektos/act) locally and available il your `$PATH`.
And then you can `make test` to launch the project locally.
And then you can `make test` to launch the project locally.

Folder `tests` contains another go.mod file with old version format using only major and minor without the patch number `1.21`.
8 changes: 8 additions & 0 deletions tests/two-digits.go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module github.com/pawndev/go-modfile-information

go 1.21

require (
github.com/sethvargo/go-githubactions v1.3.0
golang.org/x/mod v0.21.0
)

0 comments on commit 038953b

Please sign in to comment.