From d9f94105c8d65679ac71690de1a8d81e1daf244b Mon Sep 17 00:00:00 2001 From: "Harry R. Schwartz" Date: Tue, 6 Jun 2023 20:17:28 -0400 Subject: [PATCH] Set up CI action to run tests This adds a test matrix for Go 1.17--1.20. It also adds a README status badge, *of course.* --- .github/workflows/release.yml | 6 +++--- .github/workflows/test.yml | 28 ++++++++++++++++++++++++++++ README.md | 3 +++ 3 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7ebf21e..a003c77 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Release Docsim +name: Release on: workflow_dispatch: @@ -12,12 +12,12 @@ jobs: runs-on: ubuntu-latest steps: - - name: Check out code into the Go module directory + - name: Check out code uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Set up Go 1.19 + - name: Install Go 1.19 uses: actions/setup-go@v4 with: go-version: 1.19 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..0d75753 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,28 @@ +name: Tests +on: [push, pull_request] +permissions: {} + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + go_version: + - "1.17" + - "1.18" + - "1.19" + - "1.20" + + steps: + - name: Check out code + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install Go + uses: actions/setup-go@v4 + with: + go-version: ${{ matrix.go_version }} + + - name: Run tests + run: 'make && make test' diff --git a/README.md b/README.md index 9bd5463..e7275a7 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # `docsim` +[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) +[![CI Status](https://github.com/hrs/docsim/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/hrs/docsim/actions/workflows/test.yml) + A simple, fast command-line tool for scoring the similarity of text documents. ``` console