From ad5aff11e10cd24b03a9aac4c372644fba647734 Mon Sep 17 00:00:00 2001 From: Alessandro Lucaferro Date: Sat, 15 Jun 2024 09:54:52 +0200 Subject: [PATCH] Migrate CI/CD from CircleCI to GitHub Actions --- .circleci/config.yml | 20 -------------------- .github/workflows/go.yml | 30 +++++++++++++++++++++--------- README.md | 9 ++++++--- 3 files changed, 27 insertions(+), 32 deletions(-) delete mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 4c48b0a..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,20 +0,0 @@ -version: 2.1 - -jobs: - build: - docker: - - image: circleci/golang:1.17 - steps: - - checkout - - run: - name: Run tests and coverage - command: go test -race -coverprofile=coverage.txt -covermode=atomic - - run: - name: Upload coverage to Codecov - command: bash <(curl -s https://codecov.io/bash) - -workflow: - version: 2.1 - build-test: - jobs: - - build diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index adbb7d1..8546c00 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,22 +1,34 @@ +# This workflow will build a golang project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go + name: Go on: push: - branches: [ main ] + branches: [ "main" ] pull_request: - branches: [ main ] + branches: [ "main" ] jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.21.3' + + - name: Build + run: go build -v ./... - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.17 + - name: Test + run: go test -race -coverprofile=coverage.txt -covermode=atomic - - name: Test - run: go test -v ./... + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + slug: logocomune/maidenhead diff --git a/README.md b/README.md index b8988e8..0210a40 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,11 @@ # Maidenhead Locator for golang -[![CircleCI](https://circleci.com/gh/logocomune/maidenhead/tree/main.svg?style=svg)](https://circleci.com/gh/logocomune/maidenhead/tree/main) -[![Go Report Card](https://goreportcard.com/badge/github.com/logocomune/maidenhead)](https://goreportcard.com/report/github.com/logocomune/maidenhead) -[![codecov](https://codecov.io/gh/logocomune/maidenhead/branch/master/graph/badge.svg)](https://codecov.io/gh/logocomune/maidenhead) + +![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/logocomune/maidenhead) +![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/logocomune/maidenhead/go.yml) +[![Go Reference](https://pkg.go.dev/badge/github.com/logocomune/maidenhead)](https://pkg.go.dev/github.com/logocomune/maidenhead) +[![codecov](https://codecov.io/gh/logocomune/maidenhead/graph/badge.svg?token=GGN3PHjyZV)](https://codecov.io/gh/logocomune/maidenhead) +[![Go Report Card](https://goreportcard.com/badge/github.com/logocomune/maidenhead)](https://goreportcard.com/report/github.com/maidenhead/maidenhead) The [Maidenhead Locator System](https://en.wikipedia.org/wiki/Maidenhead_Locator_System) (a.k.a. QTH Locator and IARU Locator) is a geocode system used by amateur radio operators