From be37f76aa9cc14f1c9af31bd9b2fbcf777805089 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Thu, 5 Oct 2023 21:46:40 +0300 Subject: [PATCH 1/6] Add GA Signed-off-by: AlexNDRmac --- .github/workflows/main.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..25c4d69 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,35 @@ +name: CI + +on: + push: + pull_request: + +jobs: + build: + name: Build and test + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: 1.19 + + - name: Setup cache + uses: actions/cache@v3 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + + - name: Build + run: make build + + - name: Run tests + run: make test From b4267ce9edc74bb9ab47723bbfc8e44c66bebaf6 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Thu, 5 Oct 2023 22:07:06 +0300 Subject: [PATCH 2/6] Remove circleci, update readme Signed-off-by: AlexNDRmac --- .circleci/config.yml | 31 ------------------------------- .github/workflows/main.yml | 5 +++++ README.md | 10 ++++++++-- 3 files changed, 13 insertions(+), 33 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 9f5671f..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,31 +0,0 @@ -version: 2 -jobs: - build: - docker: - - image: circleci/golang:1.12 - steps: - - checkout - - - restore_cache: - keys: - - go-mod-v4-{{ checksum "go.sum" }} - - run: - name: Run unit tests - command: | - make test - - - run: make build - - - run: make run - - - save_cache: - key: go-mod-v4-{{ checksum "go.sum" }} - paths: - - "/go/pkg/mod" - -workflows: - version: 2 - build-workflow: - jobs: - - build - diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 25c4d69..5cd1c44 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,6 +2,8 @@ name: CI on: push: + paths-ignore: + - '**.md' pull_request: jobs: @@ -33,3 +35,6 @@ jobs: - name: Run tests run: make test + + - name: Run app + run: make run diff --git a/README.md b/README.md index 893ef5e..48b5238 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Duration -[![CircleCI](https://circleci.com/gh/mstruebing/duration.svg?style=svg)](https://circleci.com/gh/mstruebing/duration) +[![CI](https://github.com/mstruebing/duration/actions/workflows/main.yml/badge.svg)](https://github.com/mstruebing/duration/actions/workflows/main.yml) [![Go Report Card](https://goreportcard.com/badge/github.com/mstruebing/duration)](https://goreportcard.com/report/github.com/mstruebing/duration) 1. [Why](#why) @@ -32,7 +32,7 @@ would work: duration script.sh would NOT work: duration sleep 5 && sleep 4 -``````````` +``` ### Important @@ -75,3 +75,9 @@ i.e: ```sh trizen -S duration-git ``` + +### License + +Duration is open source software licensed under the MIT License. + +See the [LICENSE](./LICENSE) file for more. From 2661115a03c27f4ff49f3446b8907e9eec688810 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Fri, 6 Oct 2023 21:12:46 +0300 Subject: [PATCH 3/6] Rename workflow Signed-off-by: AlexNDRmac --- .github/workflows/{main.yml => ci.yml} | 0 README.md | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{main.yml => ci.yml} (100%) diff --git a/.github/workflows/main.yml b/.github/workflows/ci.yml similarity index 100% rename from .github/workflows/main.yml rename to .github/workflows/ci.yml diff --git a/README.md b/README.md index 48b5238..6c7fdc6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Duration -[![CI](https://github.com/mstruebing/duration/actions/workflows/main.yml/badge.svg)](https://github.com/mstruebing/duration/actions/workflows/main.yml) +[![CI](https://github.com/mstruebing/duration/actions/workflows/ci.yml/badge.svg)](https://github.com/mstruebing/duration/actions/workflows/ci.yml) [![Go Report Card](https://goreportcard.com/badge/github.com/mstruebing/duration)](https://goreportcard.com/report/github.com/mstruebing/duration) 1. [Why](#why) From dc8eee7f1bc1dccd13cd3c0c1cccdb8bd68d159f Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Fri, 6 Oct 2023 21:24:02 +0300 Subject: [PATCH 4/6] Use go 1.20 Signed-off-by: AlexNDRmac --- .github/workflows/ci.yml | 2 +- go.mod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5cd1c44..1bbf5ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v4 with: - go-version: 1.19 + go-version: 1.20 - name: Setup cache uses: actions/cache@v3 diff --git a/go.mod b/go.mod index 8a74649..e6435e8 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/mstruebing/duration -go 1.12 +go 1.20 require ( github.com/buger/goterm v0.0.0-20181115115552-c206103e1f37 From 93f8f96147ba552e6128e2b12197735eb97a187b Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Fri, 6 Oct 2023 21:32:20 +0300 Subject: [PATCH 5/6] update packages Signed-off-by: AlexNDRmac --- go.mod | 7 +++---- go.sum | 5 +++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index e6435e8..b3fb619 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,6 @@ module github.com/mstruebing/duration go 1.20 -require ( - github.com/buger/goterm v0.0.0-20181115115552-c206103e1f37 - golang.org/x/sys v0.0.0-20190610081024-1e42afee0f76 // indirect -) +require github.com/buger/goterm v1.0.4 + +require golang.org/x/sys v0.13.0 // indirect diff --git a/go.sum b/go.sum index 42304d5..bb247e6 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,9 @@ github.com/buger/goterm v0.0.0-20181115115552-c206103e1f37 h1:uxxtrnACqI9zK4ENDMf0WpXfUsHP5V8liuq5QdgDISU= github.com/buger/goterm v0.0.0-20181115115552-c206103e1f37/go.mod h1:u9UyCz2eTrSGy6fbupqJ54eY5c4IC8gREQ1053dK12U= +github.com/buger/goterm v1.0.4 h1:Z9YvGmOih81P0FbVtEYTFF6YsSgxSUKEhf/f9bTMXbY= +github.com/buger/goterm v1.0.4/go.mod h1:HiFWV3xnkolgrBV3mY8m0X0Pumt4zg4QhbdOzQtB8tE= golang.org/x/sys v0.0.0-20190610081024-1e42afee0f76 h1:QSmW7Q3mFdAGjtAd0byXmFJ55inUydyZ4WQmiuItAIQ= golang.org/x/sys v0.0.0-20190610081024-1e42afee0f76/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210331175145-43e1dd70ce54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= +golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= From 46149626fd1aa86fec501e432f7d4cb26ef732a4 Mon Sep 17 00:00:00 2001 From: AlexNDRmac Date: Fri, 6 Oct 2023 21:42:18 +0300 Subject: [PATCH 6/6] Fix go version declaration Signed-off-by: AlexNDRmac --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1bbf5ad..34e2335 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v4 with: - go-version: 1.20 + go-version: '1.20' - name: Setup cache uses: actions/cache@v3