Skip to content

Commit

Permalink
add ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ybirader committed Sep 24, 2023
1 parent a600225 commit dc7a0e1
Showing 1 changed file with 91 additions and 0 deletions.
91 changes: 91 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Tests

on:
push:
branches:
- main
pull_request:
branches:
- main



jobs:
test:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
go:
- '1.21'
include:
- go: '1.21'
GO_SEMVER: '~1.21.0'

- os: ubuntu-latest
PZIP_BIN_PATH: ./cmd/pzip/pzip
PUNZIP_BIN_PATH: ./cmd/punzip/punzip
SUCCESS: 0

- os: macos-latest
PZIP_BIN_PATH: ./cmd/pzip/pzip
PUNZIP_BIN_PATH: ./cmd/punzip/punzip
SUCCESS: 0

- os: windows-latest
PZIP_BIN_PATH: ./cmd/pzip/pzip.exe
PUNZIP_BIN_PATH: ./cmd/punzip/punzip.exe
SUCCESS: 'True'

runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.GO_SEMVER }}
check-latest: true

- name: Get dependencies
run: |
go get -v -t -d ./...
- name: Build pzip
working-directory: ./cmd/pzip
env:
CGO_ENABLED: 0
run: |
go build -v
- name: Build punzip
working-directory: ./cmd/punzip
env:
CGO_ENABLED: 0
run: |
go build -v
- name: Run tests
run: |
go test -v -race ./...
goreleaser-check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: check
env:
TAG: ${{ steps.vars.outputs.version_tag }}

0 comments on commit dc7a0e1

Please sign in to comment.