Skip to content

Commit

Permalink
Cache github build action (#88)
Browse files Browse the repository at this point in the history
* Change Go action to build and add cache

* Add dependency download step

* Rearrange steps

* Remove docker build

* Change build tag

* Enable Build on pull_request

* Add linter checking

* Add linter cache

* Correct spelling

* Change lint cache path

* Cache go/bin instead

* Add go bin to path

* Correct command syntax

* Test linter

* Change cache step id

* Change cache search pattern

* Remove linter cache
  • Loading branch information
oluwandabira authored and beansgum committed Jan 16, 2020
1 parent 310b336 commit 90ae17f
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 34 deletions.
45 changes: 27 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,36 @@
name: Go
on: [push]
name: Build
on: [push, pull_request]
jobs:

build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v1

- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go

- name: Set up Go 1.13
uses: actions/setup-go@v1
with:
go-version: 1.13
id: go
- name: Cache (dependencies)
uses: actions/cache@v1
id: cache
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Check out code into the Go module directory
uses: actions/checkout@v1

- name: Install linter
run: "curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.22.2"

- name: Build, run tests and vet
run: |
go build
go test
go vet
env:
GO111MODULE: "on"
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: go mod download

- name: Lint
run: |
export PATH=$PATH:~/go/bin
./run_tests.sh lint
11 changes: 0 additions & 11 deletions .github/workflows/docker.yml

This file was deleted.

7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
# dcrlibwallet

[![Build Status](https://img.shields.io/github/workflow/status/raedahgroup/dcrlibwallet/Go)](https://github.com/raedahgroup/dcrlibwallet/actions)
[![Build Status](https://github.com/raedahgroup/dcrlibwallet/workflows/Build/badge.svg)](https://github.com/raedahgroup/dcrlibwallet/actions)

A Decred wallet library written in golang for [dcrwallet](https://github.com/decred/dcrwallet)

## Build Dependencies

[Go( >= 1.11 )](http://golang.org/doc/install)
[Gomobile](https://github.com/golang/go/wiki/Mobile#tools) (correctly init'd with gomobile init)
[Gomobile](https://github.com/golang/go/wiki/Mobile#tools) (correctly init'd with gomobile init)

## Build Instructions using Gomobile

To build this libary, clone the project
To build this libary, clone the project

```bash
go get -t github.com/raedahgroup/dcrlibwallet
cd $GOPATH/src/github.com/raedahgroup/dcrlibwallet/
```

and run the following commands in dcrlibwallet directory.

```bash
Expand Down
2 changes: 0 additions & 2 deletions run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,3 @@ elif [[ "$option" = "all" ]]; then
else
echo "Usage: ./run_tests.sh [all | build | lint]"
fi


0 comments on commit 90ae17f

Please sign in to comment.