From 0162ffdbba090a53c4fe10ee033b0e1e1f59d363 Mon Sep 17 00:00:00 2001 From: dyma solovei Date: Mon, 15 Jan 2024 12:31:07 +0100 Subject: [PATCH 1/4] ci: add build workflow This workflow will build and test the project and calculate test coverage on every: - push to main - new PR to main created - commits added to PRs targeting main --- .github/workflows/build.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..2c76654 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,35 @@ +# 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: Build and test + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + + build: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest, windows-latest ] + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-go@v4 + with: + go-version: '1.18' + + - name: Build + run: go build -v ./... + + - name: Test with coverage + run: go test -v -race -covermode=atomic -coverprofile=coverage.out ./... + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} From 1ec200f58d672ed2e345bd08d020fe987813f62d Mon Sep 17 00:00:00 2001 From: dyma solovei <53943884+bevzzz@users.noreply.github.com> Date: Mon, 15 Jan 2024 12:45:50 +0100 Subject: [PATCH 2/4] ci: drop windows from build targets --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2c76654..b1f1744 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ ubuntu-latest, windows-latest ] + os: [ ubuntu-latest ] steps: - uses: actions/checkout@v3 From 71264a4f2e9a0adbc02dddcd995525b773177bc1 Mon Sep 17 00:00:00 2001 From: dyma solovei <53943884+bevzzz@users.noreply.github.com> Date: Mon, 15 Jan 2024 13:08:16 +0100 Subject: [PATCH 3/4] chore: add badges to README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index d8d3e01..ab867a4 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ # nb +[![Build status](https://github.com/bevzzz/nb/actions/workflows/build.yml/badge.svg?branch=ci)](https://github.com/bevzzz/nb/actions/workflows/build.yml?query=branch%3Amain) +[![Go Reference](https://pkg.go.dev/badge/github.com/bevzzz/nb.svg)](https://pkg.go.dev/github.com/bevzzz/nb) +[![Go Report Card](https://goreportcard.com/badge/github.com/bevzzz/nb)](https://goreportcard.com/report/github.com/bevzzz/nb) +[![codecov](https://codecov.io/gh/bevzzz/nb/branch/main/graph/badge.svg?token=BS7XDXHA21)](https://codecov.io/gh/bevzzz/nb/tree/main) + Render Jupyter Notebooks in pure Go 📔 This package is inspired by @yuin's [`goldmark`](https://github.com/yuin/goldmark) and is designed to be as clear and extensible. From 698e50f68041ad07e45e1ed67c45965bddda0e3f Mon Sep 17 00:00:00 2001 From: dyma solovei <53943884+bevzzz@users.noreply.github.com> Date: Mon, 15 Jan 2024 13:09:14 +0100 Subject: [PATCH 4/4] ci: rename workflow to build Looks better in a README badge --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b1f1744..9a1a0e2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,7 +1,7 @@ # 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: Build and test +name: build on: push: