Skip to content

Commit

Permalink
Reverse the order of versions
Browse files Browse the repository at this point in the history
It appears more natural to have the versions in the matrix in
ascending order.
  • Loading branch information
arnested committed May 9, 2022
1 parent a77b85c commit 9f3cb5a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ jobs:
- run: |
test '${{ steps.go-version.outputs.latest }}' == '1.18'
- run: |
test '${{ steps.go-version.outputs.matrix }}' == '["1.18","1.17","1.16","1.15","1.14","1.13"]'
test '${{ steps.go-version.outputs.matrix }}' == '["1.13","1.14","1.15","1.16","1.17","1.18"]'
4 changes: 2 additions & 2 deletions __tests__/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ test('test minimal version', () => {
})

test('test latest version', () => {
expect(latest(['1.18', '1.17', '1.16', '1.15', '1.14', '1.13'])).toEqual(
expect(latest(['1.13', '1.14', '1.15', '1.16', '1.17', '1.18'])).toEqual(
'1.18'
)
})

test('test version matrix', () => {
const t = JSON.parse(fs.readFileSync('__tests__/testdata/dl.json', 'utf8'))
const m = matrix('1.13', t)
expect(m).toEqual(['1.18', '1.17', '1.16', '1.15', '1.14', '1.13'])
expect(m).toEqual(['1.13', '1.14', '1.15', '1.16', '1.17', '1.18'])
})
2 changes: 1 addition & 1 deletion src/go-versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const matrix = (min: string, tags: Version[]): string[] => {
return v2 !== null && semverGte(v2, minClean)
})

return versions
return versions.reverse()
}

const latest = (versions: string[]): string => {
Expand Down

0 comments on commit 9f3cb5a

Please sign in to comment.