Skip to content

Commit

Permalink
Use better CI scripts (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
cristaloleg authored Jan 22, 2022
1 parent 8b80431 commit 34bd9e4
Showing 1 changed file with 7 additions and 45 deletions.
52 changes: 7 additions & 45 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,22 @@ name: build

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
workflow_dispatch:
inputs:
tag:
description: 'Tag to create'
required: true
default: 'v0.0.0'

# See https://github.com/cristalhq/.github/.github/workflows
jobs:

build:
name: Build & Test
runs-on: ubuntu-latest

steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.15

- name: Check out code
uses: actions/checkout@v2

- name: Download module dependencies
env:
GOPROXY: "https://proxy.golang.org"
run: go mod download

- name: Test
run: go test -v -coverprofile=coverage.txt ./...

- name: Upload Coverage
uses: codecov/codecov-action@v1
continue-on-error: true
with:
token: ${{secrets.CODECOV_TOKEN}}
file: ./coverage.txt
fail_ci_if_error: false
test:
uses: cristalhq/.github/.github/workflows/test.yml@d310feb31f65450fb641e8fd98645b705080a913

release:
if: github.event_name == 'workflow_dispatch'

name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Checkout with tags
run: git fetch --prune --unshallow --tags

- name: Create release
run: |
git log --format="%C(auto) %H %s" `git tag --sort=-committerdate | head -1`...HEAD > changelog.txt
echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token
gh release create ${{ github.event.inputs.tag }} -F changelog.txt
uses: cristalhq/.github/.github/workflows/release.yml@d310feb31f65450fb641e8fd98645b705080a913
with:
tag: ${{ github.event.input.tag }}

0 comments on commit 34bd9e4

Please sign in to comment.