From 237002085070c1c2a6951e1df00a8074c8f7dc31 Mon Sep 17 00:00:00 2001 From: Yusuf Birader Date: Sun, 24 Sep 2023 13:31:45 +0100 Subject: [PATCH] add ci --- .github/workflows/ci.yml | 72 ++++++++++++++++++++++++++++++++++++++++ .goreleaser.yaml | 2 -- 2 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..5345e2e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,72 @@ +name: Tests + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + test: + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - macos-latest + go: + - '1.21' + include: + - go: '1.21' + GO_SEMVER: '~1.21.0' + + 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 }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml index d7b7909..972f08f 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -13,7 +13,6 @@ builds: binary: pzip goos: - linux - - windows - darwin - freebsd goarch: @@ -27,7 +26,6 @@ builds: binary: punzip goos: - linux - - windows - darwin - freebsd goarch: