Skip to content

Commit

Permalink
ci(golang): download package dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Nov 30, 2021
1 parent ed7177b commit e3ce528
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 11 deletions.
29 changes: 29 additions & 0 deletions .github/actions/restore-golang/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Agoric SDK restore Golang build
description: 'Set up Golang environment and restore cached built files'

inputs:
go-version:
description: 'The version of Go to use'
required: true

runs:
using: composite
steps:
- uses: actions/checkout@v2
with:
clean: 'false'
submodules: 'true'
- uses: actions/setup-go@v1
with:
go-version: ${{ inputs.go-version }}
- name: cache Go modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('packages/cosmic-swingset/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: go mod download
run: go mod download
shell: bash
if: steps.built.outputs.cache-hit != 'true'
6 changes: 6 additions & 0 deletions .github/workflows/deployment-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,15 @@ jobs:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/restore-golang
with:
go-version: 1.15
- uses: ./.github/actions/restore-node
with:
node-version: 14.x
- name: Build cosmic-swingset dependencies
run: make install
working-directory: packages/cosmic-swingset
- run: sudo ./packages/deployment/scripts/install-deps.sh
- run: "$GITHUB_WORKSPACE/packages/deployment/scripts/integration-test.sh"
working-directory: ${{ env.HOME }}
Expand Down
12 changes: 1 addition & 11 deletions .github/workflows/test-golang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'true'
- name: Set up Go 1.15
uses: actions/setup-go@v1
- uses: ./.github/actions/restore-golang
with:
go-version: 1.15
- name: cache Go modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('packages/cosmic-swingset/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: go test
run: cd golang && go test ./...

0 comments on commit e3ce528

Please sign in to comment.