mirror of
https://github.com/avelino/awesome-go.git
synced 2024-11-07 16:33:40 +00:00
37 lines
1.0 KiB
YAML
37 lines
1.0 KiB
YAML
name: tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'main'
|
|
pull_request:
|
|
|
|
permissions:
|
|
pull-requests: write # required for posting comments
|
|
contents: write # required for git push
|
|
|
|
jobs:
|
|
build:
|
|
name: Running test
|
|
runs-on: ubuntu-latest
|
|
container: golang:latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Verify Changed files
|
|
id: verify-changed-files
|
|
uses: tj-actions/verify-changed-files@v20
|
|
with:
|
|
files: "!*.md"
|
|
- name: Get dependencies
|
|
if: steps.verify-changed-files.outputs.files_changed == 'true'
|
|
run: go get -v -t -d ./...
|
|
- name: Run tests
|
|
if: steps.verify-changed-files.outputs.files_changed == 'true'
|
|
run: go test -coverprofile=cover.out main_test.go main.go
|
|
- name: Install Vim
|
|
if: steps.verify-changed-files.outputs.files_changed == 'true'
|
|
run: apt-get update; apt-get install -y vim;
|
|
- name: Go Beautiful HTML Coverage
|
|
if: steps.verify-changed-files.outputs.files_changed == 'true'
|
|
uses: gha-common/go-beautiful-html-coverage@v1
|