Skip to content

Commit

Permalink
move lint to test CI
Browse files Browse the repository at this point in the history
  • Loading branch information
iofq committed Sep 18, 2024
1 parent 0bc7189 commit 19ef2dd
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 82 deletions.
39 changes: 23 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ jobs:
GOPROXY: "https://proxy.golang.org"

steps:
- name: "Install packages"
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends graphviz gnupg2 gpgv2 git gcc make devscripts
- name: "Checkout repository"
uses: actions/checkout@v3
with:
Expand All @@ -51,14 +46,20 @@ jobs:
with:
go-version: ${{ steps.goversion.outputs.GOVER }}

- name: "Get aptly version"
run: |
make version > VERSION
cat VERSION
- name: Lint with golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.54.1

- name: "Get aptly version"
- name: "Install packages"
run: |
make version
sudo apt-get update
sudo apt-get install -y --no-install-recommends graphviz gnupg2 gpgv2 git gcc make devscripts
- name: "Setup Python"
uses: actions/setup-python@v4
Expand Down Expand Up @@ -103,15 +104,9 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.txt

<<<<<<< HEAD
ci-debian:
name: "CI Build"
needs: build
=======
ci-debian-build:
name: "CI Build (Deb)"
needs: test
>>>>>>> ad4ffa51 (use multiarch CI build for release)
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -197,9 +192,10 @@ jobs:
./upload-artifacts.sh release ${{ matrix.suite }}
ci-release-build:
name: "CI Build (Binary)"
name: "CI Build (Binary Release)"
needs: test
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
strategy:
matrix:
goos: [linux, freebsd, darwin]
Expand Down Expand Up @@ -230,6 +226,7 @@ jobs:
env:
GOBIN: /usr/local/bin
run: |
set -ex
mkdir -p tmp/man tmp/completion/bash_completion.d tmp/completion/zsh/vendor-completions
go version
echo ${{ github.ref_name }} > VERSION
Expand All @@ -238,9 +235,11 @@ jobs:
cp completion.d/aptly tmp/completion/bash_completion.d/
cp completion.d/_aptly tmp/completion/zsh/vendor-completions/
gzip tmp/man/aptly.1
path="aptly_${{ github.ref_name }}_${{ matrix.goos }}_${{ matrix.goarch }}"
path=aptly_${{ github.ref_name }}_${{ matrix.goos }}_${{ matrix.goarch }}
mv tmp "$path"
zip -r "$path" . -i "$path/*"
ls -R "$path"
zip -r aptly . -i "${path}/**"
mv aptly.zip "${path}.zip"
- uses: actions/upload-artifact@v4
with:
Expand All @@ -258,7 +257,15 @@ jobs:
uses: actions/download-artifact@v4
with:
path: out/

- name: Create Changelog
id: changelog
uses: mikepenz/release-changelog-builder-action@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Release
uses: softprops/action-gh-release@v2
with:
files: "out/**/aptly_*.zip"
body: ${{ steps.changelog.outputs.changelog }}
65 changes: 0 additions & 65 deletions .github/workflows/golangci-lint.yml

This file was deleted.

24 changes: 23 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ prepare: ## Install go module dependencies
go mod tidy -v
go generate

dev:
PATH=$(BINPATH)/:$(PATH)
go get github.com/laher/goxc
go install github.com/laher/goxc

check: system/env
ifeq ($(RUN_LONG_TESTS), yes)
system/env/bin/flake8
Expand Down Expand Up @@ -83,6 +88,23 @@ mem.png: mem.dat mem.gp
gnuplot mem.gp
open mem.png

goxc: dev
rm -rf root/
mkdir -p root/usr/share/man/man1/ root/etc/bash_completion.d/ root/usr/share/zsh/vendor-completions/
cp man/aptly.1 root/usr/share/man/man1
cp completion.d/aptly root/etc/bash_completion.d/
cp completion.d/_aptly root/usr/share/zsh/vendor-completions/
gzip root/usr/share/man/man1/aptly.1
GOPATH=$(PWD)/.go go generate
GOPATH=$(PWD)/.go goxc -pv=$(VERSION) -max-processors=4 $(GOXC_OPTS)

release: GOXC_OPTS=-tasks-=go-vet,go-test,rmbin
release: goxc
rm -rf build/
mkdir -p build/
mv xc-out/$(VERSION)/aptly_$(VERSION)_* build/
ls -l build/

man: ## Create man pages
make -C man

Expand Down Expand Up @@ -131,4 +153,4 @@ clean: ## remove local build and module cache
test -d .go/ && chmod u+w -R .go/ && rm -rf .go/ || true
rm -rf build/ docs/ obj-*-linux-gnu*

.PHONY: help man prepare version release docker-build-aptly-dev docker-system-tests docker-unit-tests docker-lint docker-build build docker-aptly clean
.PHONY: help man prepare version release goxc docker-build-aptly-dev docker-system-tests docker-unit-tests docker-lint docker-build build docker-aptly clean

0 comments on commit 19ef2dd

Please sign in to comment.