Skip to content

Commit

Permalink
Merge pull request #85 from cpuguy83/updates
Browse files Browse the repository at this point in the history
Update go in tests and Dockerfile
  • Loading branch information
cpuguy83 committed Apr 22, 2022
2 parents d33c36c + 4a927df commit d970781
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 16 deletions.
27 changes: 13 additions & 14 deletions .github/workflows/test.yml
Expand Up @@ -2,33 +2,32 @@ name: Go

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]

jobs:

test:
name: Build
strategy:
matrix:
go-version: [1.13.x, 1.15.x, 1.16.x]
go-version: [1.13.x, 1.15.x, 1.16.x, 1.17.x, 1.18.x]
platform: [ubuntu-20.04]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}

- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Build
run: go build -v ./...
- name: Build
run: go build -v ./...

- name: Test
run: go test -v ./...
- name: Test
run: go test -v ./...

lint:
runs-on: ubuntu-20.04
Expand Down
16 changes: 14 additions & 2 deletions Dockerfile
@@ -1,7 +1,19 @@
FROM golang:1.8 AS build
ARG GO_VERSION=1.18
ARG GO_IMAGE=golang:${GO_VERSION}

FROM --platform=$BUILDPLATFORM $GO_IMAGE AS build
COPY . /go/src/github.com/cpuguy83/go-md2man
WORKDIR /go/src/github.com/cpuguy83/go-md2man
RUN CGO_ENABLED=0 go build
ARG TARGETOS
ARG TARGETARCH
ARG TARGETVARIANT
RUN \
export GOOS="${TARGETOS}"; \
export GOARCH="${TARGETARCH}"; \
if [ "${TARGETARCH}" = "arm" ] && [ "${TARGETVARIANT}" ]; then \
export GOARM="${TARGETVARIANT#v}"; \
fi; \
CGO_ENABLED=0 go build

FROM scratch
COPY --from=build /go/src/github.com/cpuguy83/go-md2man/go-md2man /go-md2man
Expand Down

0 comments on commit d970781

Please sign in to comment.