Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Edjroz/enhancement/test coverage releases #164

Merged
merged 10 commits into from
May 16, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .github/workflows/go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
branches: [ main ]

jobs:

build:
runs-on: ubuntu-latest
steps:
Expand All @@ -24,3 +23,15 @@ jobs:
- name: Test
run: go test -v ./...

- name: Calc coverage
run: |
go test -v -covermode=count -coverprofile=coverage.out

- name: Convert coverage.out to coverage.lcov
uses: jandelgado/gcov2lcov-action@v1.0.6

- name: Coveralls
uses: coverallsapp/github-action@v1.1.2
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: coverage.lcov
32 changes: 32 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release

on:
push:
branches: [main]
edjroz marked this conversation as resolved.
Show resolved Hide resolved
tags: ["v*"]
edjroz marked this conversation as resolved.
Show resolved Hide resolved

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
db_backend: [ goleveldb ]
env: # Or as an environment variable
steps:
- uses: actions/checkout@v3
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
- uses: actions/setup-go@v2
with:
go-version: "^1.17" # The Go version to download (if necessary) and use.
aelesbao marked this conversation as resolved.
Show resolved Hide resolved
- name: Build
run: |
VERSION=${{ steps.get_version.outputs.VERSION }} DB_BACKEND=${{ matrix.db_backend }} make build
tar -czvf archwayd_${{ steps.get_version.outputs.VERSION }}_${{ matrix.os }}.tar.gz build/archwayd
- uses: actions/upload-artifact@v2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The actions/upload-artifact@v2 action is to upload artifacts to workflow runs so that the next step can download them. To add assets to a GitHub release, you should use an action that interacts with the Releases API.

with:
name: archwayd_${{ steps.get_version.outputs.VERSION }}_${{ matrix.os }}.tar.gz
path: archwayd_${{ steps.get_version.outputs.VERSION }}_${{ matrix.os }}.tar.gz