Skip to content

Commit

Permalink
Merge pull request #130 from michimani/michimani/issue129
Browse files Browse the repository at this point in the history
bump Go vertion to 1.22
  • Loading branch information
michimani authored Feb 13, 2024
2 parents 9a3483d + 7ab47b8 commit 6dda328
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 87 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/onlytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,30 @@ on:
- main
pull_request:
branches:
- '**'
- "**"
paths:
- '**.go'
- 'go.mod'
- 'go.sum'
- "**.go"
- "go.mod"
- "go.sum"

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v3
with:
go-version: 1.21
- name: Set up Go 1.22
uses: actions/setup-go@v3
with:
go-version: 1.22

- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Get dependencies
run: go install
- name: Get dependencies
run: go install

- name: Test code
run: go test -race -coverprofile="coverage.txt" -covermode=atomic github.com/michimani/go-esa/... -shuffle=on
- name: Test code
run: go test -race -coverprofile="coverage.txt" -covermode=atomic github.com/michimani/go-esa/... -shuffle=on

- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v2
- name: Upload code coverage to Codecov
uses: codecov/codecov-action@v2
118 changes: 59 additions & 59 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,80 +9,80 @@ jobs:
name: Test
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v3
with:
go-version: 1.21
- name: Set up Go 1.22
uses: actions/setup-go@v3
with:
go-version: 1.22

- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Get dependencies
run: go install
- name: Get dependencies
run: go install

- name: Test code
run: go test github.com/michimani/go-esa/... -shuffle=on
- name: Test code
run: go test github.com/michimani/go-esa/... -shuffle=on

setup-release:
name: Setup release
needs: test
runs-on: ubuntu-latest
steps:
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Get url to upload to release from output
env:
url: ${{ steps.create_release.outputs.upload_url }}
run: |
mkdir artifact
echo $url > artifact/url.txt
- name: Upload artifact to share url with other jobs
uses: actions/upload-artifact@v1
with:
name: artifact
path: artifact/url.txt
- name: Get url to upload to release from output
env:
url: ${{ steps.create_release.outputs.upload_url }}
run: |
mkdir artifact
echo $url > artifact/url.txt
- name: Upload artifact to share url with other jobs
uses: actions/upload-artifact@v1
with:
name: artifact
path: artifact/url.txt

release-code:
name: Release Source Code
needs: setup-release
runs-on: ubuntu-latest
steps:
- name: Download artifact to get url to upload to release
uses: actions/download-artifact@v2
with:
name: artifact
- name: Download artifact to get url to upload to release
uses: actions/download-artifact@v2
with:
name: artifact

- name: Get url to upload to release from artifact
id: get_url
run: |
pwd
ls -al
url=$(cat url.txt)
echo "##[set-output name=upload_url;]$url"
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Get url to upload to release from artifact
id: get_url
run: |
pwd
ls -al
url=$(cat url.txt)
echo "##[set-output name=upload_url;]$url"
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Pack source code in zip file
run: |
mkdir dist
ls -la
cp *.go dist/
zip -j -r release dist
- name: Upload release asset
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_url.outputs.upload_url }}
asset_path: release.zip
asset_name: source.zip
asset_content_type: application/zip
- name: Pack source code in zip file
run: |
mkdir dist
ls -la
cp *.go dist/
zip -j -r release dist
- name: Upload release asset
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_url.outputs.upload_url }}
asset_path: release.zip
asset_name: source.zip
asset_content_type: application/zip
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module github.com/michimani/go-esa

go 1.21
go 1.22

require github.com/stretchr/testify v1.7.0
require github.com/stretchr/testify v1.8.4

require (
github.com/davecgh/go-spew v1.1.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
14 changes: 6 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA=
gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

0 comments on commit 6dda328

Please sign in to comment.