Skip to content

Commit

Permalink
Merge pull request #115 from essentialkaos/develop
Browse files Browse the repository at this point in the history
Version 1.0.5
  • Loading branch information
andyone authored Jun 24, 2024
2 parents cc9ccef + 8b685e3 commit d0aa9a4
Show file tree
Hide file tree
Showing 13 changed files with 161 additions and 107 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ updates:
- "andyone"
reviewers:
- "andyone"
groups:
all:
applies-to: version-updates
update-types:
- "minor"
- "patch"

- package-ecosystem: "github-actions"
directory: "/"
Expand Down
5 changes: 5 additions & 0 deletions .github/images/card.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .github/images/godoc.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions .github/images/license.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
69 changes: 40 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,55 +5,58 @@ on:
branches: [master, develop]
pull_request:
branches: [master]
workflow_dispatch:
inputs:
force_run:
description: 'Force workflow run'
required: true
type: choice
options: [yes, no]

permissions:
actions: read
contents: read
statuses: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
Go:
name: Go
runs-on: ubuntu-latest

env:
SRC_DIR: src/github.com/${{ github.repository }}

strategy:
matrix:
go: [ '1.17.x', '1.18.x' ]
go: [ '1.21.x', '1.22.x' ]

steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}

- name: Install 7zip
run: sudo apt-get install -y -qq p7zip-full

- name: Print 7zip version
run: 7za -h

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
path: ${{env.SRC_DIR}}
go-version: ${{ matrix.go }}

- name: Download dependencies
working-directory: ${{env.SRC_DIR}}
run: make deps-test
run: make deps

- name: Run tests
working-directory: ${{env.SRC_DIR}}
run: go test -covermode=count -coverprofile=cover.out

- name: Send coverage data
uses: essentialkaos/goveralls-action@v1
uses: essentialkaos/goveralls-action@v2
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
path: ${{env.SRC_DIR}}
profile: cover.out
parallel: true
flag-name: linux-${{ matrix.go }}
Expand All @@ -66,7 +69,7 @@ jobs:

steps:
- name: Finish parallel tests
uses: essentialkaos/goveralls-action@v1
uses: essentialkaos/goveralls-action@v2
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand All @@ -78,22 +81,30 @@ jobs:

needs: Go

env:
SRC_DIR: src/github.com/${{ github.repository }}

steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.17.x'

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
path: ${{env.SRC_DIR}}
go-version: '1.21.x'

- name: Check Golang sources with Aligo
uses: essentialkaos/aligo-action@v1
uses: essentialkaos/aligo-action@v2
with:
path: ${{env.SRC_DIR}}
files: ./...

Typos:
name: Typos
runs-on: ubuntu-latest

needs: Go

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

- name: Check spelling
continue-on-error: true
uses: crate-ci/typos@master
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: go

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
2 changes: 2 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[files]
extend-exclude = ["go.sum"]
95 changes: 76 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,47 +1,104 @@
################################################################################

# This Makefile generated by GoMakeGen 1.5.1 using next command:
# This Makefile generated by GoMakeGen 3.0.2 using next command:
# gomakegen --mod .
#
# More info: https://kaos.sh/gomakegen

################################################################################

export GO111MODULE=on
ifdef VERBOSE ## Print verbose information (Flag)
VERBOSE_FLAG = -v
endif

COMPAT ?= 1.19
MAKEDIR = $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
GITREV ?= $(shell test -s $(MAKEDIR)/.git && git rev-parse --short HEAD)

################################################################################

.DEFAULT_GOAL := help
.PHONY = fmt vet deps deps-test test mod-init mod-update mod-vendor help
.PHONY = fmt vet deps update test init vendor mod-init mod-update mod-download mod-vendor help

################################################################################

deps: mod-update ## Download dependencies
init: mod-init ## Initialize new module

deps: mod-download ## Download dependencies

update: mod-update ## Update dependencies to the latest versions

deps-test: deps ## Download dependencies for tests
vendor: mod-vendor ## Make vendored copy of dependencies

test: ## Run tests
go test -covermode=count .
@echo "Starting tests…"
ifdef COVERAGE_FILE ## Save coverage data into file (String)
@go test $(VERBOSE_FLAG) -covermode=count -coverprofile=$(COVERAGE_FILE) .
else
@go test $(VERBOSE_FLAG) -covermode=count .
endif

mod-init:
@echo "[1/2] Modules initialization…"
ifdef MODULE_PATH ## Module path for initialization (String)
@go mod init $(MODULE_PATH)
else
@go mod init
endif

@echo "[2/2] Dependencies cleanup…"
ifdef COMPAT ## Compatible Go version (String)
@go mod tidy $(VERBOSE_FLAG) -compat=$(COMPAT) -go=$(COMPAT)
else
@go mod tidy $(VERBOSE_FLAG)
endif

mod-update:
@echo "[1/4] Updating dependencies…"
ifdef UPDATE_ALL ## Update all dependencies (Flag)
@go get -u $(VERBOSE_FLAG) all
else
@go get -u $(VERBOSE_FLAG) ./...
endif

@echo "[2/4] Stripping toolchain info…"
@grep -q 'toolchain ' go.mod && go mod edit -toolchain=none || :

@echo "[3/4] Dependencies cleanup…"
ifdef COMPAT
@go mod tidy $(VERBOSE_FLAG) -compat=$(COMPAT)
else
@go mod tidy $(VERBOSE_FLAG)
endif

mod-init: ## Initialize new module
go mod init
go mod tidy
@echo "[4/4] Updating vendored dependencies…"
@test -d vendor && rm -rf vendor && go mod vendor $(VERBOSE_FLAG) || :

mod-update: ## Download modules to local cache
go mod download
mod-download:
@echo "Downloading dependencies…"
@go mod download

mod-vendor: ## Make vendored copy of dependencies
go mod vendor
mod-vendor:
@echo "Vendoring dependencies…"
@rm -rf vendor && go mod vendor $(VERBOSE_FLAG) || :

fmt: ## Format source code with gofmt
find . -name "*.go" -exec gofmt -s -w {} \;
@echo "Formatting sources…"
@find . -name "*.go" -exec gofmt -s -w {} \;

vet: ## Runs go vet over sources
go vet -composites=false -printfuncs=LPrintf,TLPrintf,TPrintf,log.Debug,log.Info,log.Warn,log.Error,log.Critical,log.Print ./...
vet: ## Runs 'go vet' over sources
@echo "Running 'go vet' over sources…"
@go vet -composites=false -printfuncs=LPrintf,TLPrintf,TPrintf,log.Debug,log.Info,log.Warn,log.Error,log.Critical,log.Print ./...

help: ## Show this info
@echo -e '\n\033[1mSupported targets:\033[0m\n'
@echo -e '\n\033[1mTargets:\033[0m\n'
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| awk 'BEGIN {FS = ":.*?## "}; {printf " \033[33m%-12s\033[0m %s\n", $$1, $$2}'
| awk 'BEGIN {FS = ":.*?## "}; {printf " \033[33m%-6s\033[0m %s\n", $$1, $$2}'
@echo -e '\n\033[1mVariables:\033[0m\n'
@grep -E '^ifdef [A-Z_]+ .*?## .*$$' $(abspath $(lastword $(MAKEFILE_LIST))) \
| sed 's/ifdef //' \
| awk 'BEGIN {FS = " .*?## "}; {printf " \033[32m%-13s\033[0m %s\n", $$1, $$2}'
@echo -e ''
@echo -e '\033[90mGenerated by GoMakeGen 1.5.1\033[0m\n'
@echo -e '\033[90mGenerated by GoMakeGen 3.0.2\033[0m\n'

################################################################################
24 changes: 5 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,20 @@
<p align="center"><a href="#readme"><img src="https://gh.kaos.st/go-zip7.svg"/></a></p>
<p align="center"><a href="#readme"><img src=".github/images/card.svg"/></a></p>

<p align="center">
<a href="https://kaos.sh/g/zip7.v1"><img src="https://gh.kaos.st/godoc.svg" alt="PkgGoDev"></a>
<a href="https://kaos.sh/g/zip7.v1"><img src=".github/images/godoc.svg"/></a>
<a href="https://kaos.sh/w/zip7/ci"><img src="https://kaos.sh/w/zip7/ci.svg" alt="GitHub Actions CI Status" /></a>
<a href="https://kaos.sh/r/zip7"><img src="https://kaos.sh/r/zip7.svg" alt="GoReportCard" /></a>
<a href="https://kaos.sh/b/zip7"><img src="https://codebeat.co/badges/11fb655d-8da8-4694-a32b-b95ff9eed602" alt="Codebeat badge" /></a>
<a href="https://kaos.sh/w/zip7/codeql"><img src="https://kaos.sh/w/zip7/codeql.svg" alt="GitHub Actions CodeQL Status" /></a>
<a href="#license"><img src="https://gh.kaos.st/apache2.svg"></a>
<a href="#license"><img src=".github/images/license.svg"/></a>
</p>

<p align="center"><a href="#installation">Installation</a> • <a href="#compatibility-and-os-support">Compatibility and OS support</a> • <a href="#build-status">Build Status</a> • <a href="#contributing">Contributing</a> • <a href="#license">License</a></p>
<p align="center"><a href="#compatibility-and-os-support">Compatibility and OS support</a> • <a href="#ci-status">CI Status</a> • <a href="#contributing">Contributing</a> • <a href="#license">License</a></p>

<br/>

`zip7` package provides methods for working with 7z archives (`p7zip` wrapper).

### Installation

Make sure you have a working Go 1.17+ workspace (_[instructions](https://golang.org/doc/install)_), then:

```
go get github.com/essentialkaos/zip7
```

If you want to update `zip7` to latest stable release, do:

```
go get -u github.com/essentialkaos/zip7
```

### Compatibility and OS support

| Version | 1.x |
Expand All @@ -44,7 +30,7 @@ go get -u github.com/essentialkaos/zip7
| FreeBSD | :heavy_check_mark: |
| Windows | :x: |

### Build Status
### CI Status

| Branch | Status |
|--------|--------|
Expand Down
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
module github.com/essentialkaos/zip7

go 1.17
go 1.18

require (
github.com/essentialkaos/check v1.3.0
github.com/essentialkaos/ek/v12 v12.44.1
github.com/essentialkaos/check v1.4.0
github.com/essentialkaos/ek/v12 v12.127.0
)

require (
github.com/kr/pretty v0.3.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/rogpeppe/go-internal v1.8.1 // indirect
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
golang.org/x/sys v0.21.0 // indirect
)
Loading

0 comments on commit d0aa9a4

Please sign in to comment.