Skip to content
Merged
Changes from all 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
75 changes: 47 additions & 28 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,51 +9,70 @@ on:
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
go-version: ['>=1.25.0']

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

- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
id: go
go-version: '>=1.25.0'

- name: Build ${{ matrix.go-version }}
- name: Build and test
run: |
make
make test

- name: Race conditions test
run: make race

- name: test Build Docker image
- name: Test Docker build
run: docker build .

docker_set_env:
docker_push:
needs: [build]
if: github.event_name == 'release'
uses: zcash/.github/.github/workflows/standard-versioning-for-docker.yaml@main
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

docker_build_push:
uses: zcash/.github/.github/workflows/build-and-push-docker-hub.yaml@main
needs: [build, docker_set_env]
if: github.event_name == 'release'
with:
image_name: ${{ github.event.repository.name }}
image_tags: ${{ needs.docker_set_env.outputs.tags }}
dockerfile: ./Dockerfile
context: .
build-args: ""
secrets:
dockerhub_registry: ${{ secrets.DOCKERHUB_REGISTRY }}
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub (electriccoinco)
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Build and push to electriccoinco
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
electriccoinco/lightwalletd:${{ github.event.release.tag_name }}
electriccoinco/lightwalletd:latest

- name: Log in to Docker Hub (zodlinc)
uses: docker/login-action@v3
with:
username: ${{ secrets.ZODLINC_DOCKERHUB_USERNAME }}
password: ${{ secrets.ZODLINC_DOCKERHUB_PASSWORD }}

- name: Push to zodlinc
run: |
TAG="${{ github.event.release.tag_name }}"
docker buildx imagetools create \
--tag zodlinc/lightwalletd:${TAG} \
electriccoinco/lightwalletd:${TAG}
docker buildx imagetools create \
--tag zodlinc/lightwalletd:latest \
electriccoinco/lightwalletd:latest
Loading