Skip to content

Commit

Permalink
fix(ci): fix builds against pacman-git (#1718)
Browse files Browse the repository at this point in the history
* fix(ci): fix builds against pacman-git

* fix(ci): fix builds against pacman-git

* update dockerfile

* update dockerfile

* update dockerfile

* fix(ci): fix builds against pacman-git

* fix(ci): fix builds against pacman-git

* update go-alpm

* update alpm

* return to lopsided images

* go mod tidy
  • Loading branch information
Jguer committed Mar 4, 2022
1 parent b52e3cf commit dc9bef0
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 24 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/testing-git.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Test against pacman-git
# This workflow is triggered on pushes to the repository.
on:
push:
paths-ignore:
- "doc/**"
- "README.md"
- ".gitignore"
branches-ignore:
- "master"
pull_request:

jobs:
build:
name: Lint and test yay
runs-on: ubuntu-latest
container:
image: jguer/yay-builder:latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: checkout pacman-git
run: |
pacman -Syu --overwrite=* --noconfirm sudo base-devel
git clone https://aur.archlinux.org/pacman-git
useradd github
chmod -R 777 pacman-git
echo 'github ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
su github -c 'cd pacman-git; yes | makepkg -si --nocheck'
- name: Run Build and Tests with pacman-git
run: make test
14 changes: 2 additions & 12 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: Test against pacman
# This workflow is triggered on pushes to the repository.
on:
push:
Expand Down Expand Up @@ -28,14 +28,4 @@ jobs:
- name: Lint
run: /app/bin/golangci-lint run ./...
- name: Run Build and Tests
run: make test
- name: checkout pacman-git
run: |
pacman -Sy --noconfirm sudo base-devel
git clone https://aur.archlinux.org/pacman-git
useradd github
chmod -R 777 pacman-git
echo 'github ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
su github -c 'cd pacman-git; yes | makepkg -si --nocheck'
- name: Run Build and Tests with pacman-git
run: make test
run: make test
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ MOFILES := $(POFILES:.po=.mo)
FLAGS ?= -trimpath -mod=readonly -modcacherw
EXTRA_FLAGS ?= -buildmode=pie
LDFLAGS := -X "main.yayVersion=${VERSION}" -X "main.localePath=${SYSTEMLOCALEPATH}" -linkmode=external
FLAGS += $(shell pacman -T 'pacman-git' && echo "-tags next")

RELEASE_DIR := ${PKGNAME}_${VERSION}_${ARCH}
PACKAGE := $(RELEASE_DIR).tar.gz
Expand Down
6 changes: 3 additions & 3 deletions ci.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM lopsided/archlinux:latest
FROM docker.io/lopsided/archlinux:devel

ENV GO111MODULE=on
WORKDIR /app

COPY go.mod .

RUN pacman -Syu --overwrite=* --needed --noconfirm go fakeroot binutils gcc make git gettext && \
RUN pacman -Syu --overwrite=* --needed --noconfirm go git && \
rm -rfv /var/cache/pacman/* /var/lib/pacman/sync/* && \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.44.0 && \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.44.2 && \
go mod download
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/Jguer/yay/v11

require (
github.com/Jguer/aur v1.0.1
github.com/Jguer/go-alpm/v2 v2.0.6
github.com/Jguer/go-alpm/v2 v2.1.1
github.com/Morganamilo/go-pacmanconf v0.0.0-20210502114700-cff030e927a5
github.com/Morganamilo/go-srcinfo v1.0.0
github.com/bradleyjkemp/cupaloy v2.3.0+incompatible
Expand Down
10 changes: 2 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
github.com/Jguer/aur v1.0.0 h1:/1oCUucvFGA5kq1vA50UstQoj5hkRQuAKYp/pyBgOz0=
github.com/Jguer/aur v1.0.0/go.mod h1:1/SQjhWahmk2xKcmAm6XO1zGqK8HgYw3xlJM6a7845E=
github.com/Jguer/aur v1.0.1 h1:+GDOq0RuVn7CXpXzd8W85/+hPNDYonRZ3ONPm87e1jo=
github.com/Jguer/aur v1.0.1/go.mod h1:1/SQjhWahmk2xKcmAm6XO1zGqK8HgYw3xlJM6a7845E=
github.com/Jguer/go-alpm/v2 v2.0.6 h1:VLavW5qFk/TJRHT3Gg7ClDukU4MNWdfkWM9yLxVkYyQ=
github.com/Jguer/go-alpm/v2 v2.0.6/go.mod h1:zU4iKCtNkDARfj5BrKJXYAQ5nIjtZbySfa0paboSmTQ=
github.com/Jguer/go-alpm/v2 v2.1.1 h1:9/5BBx3iex1e37FocJ4GICa6zHvt8BU4KzfyB9MATQg=
github.com/Jguer/go-alpm/v2 v2.1.1/go.mod h1:uLQcTMNM904dRiGU+/JDtDdd7Nd8mVbEVaHjhmziT7w=
github.com/Morganamilo/go-pacmanconf v0.0.0-20210502114700-cff030e927a5 h1:TMscPjkb1ThXN32LuFY5bEYIcXZx3YlwzhS1GxNpn/c=
github.com/Morganamilo/go-pacmanconf v0.0.0-20210502114700-cff030e927a5/go.mod h1:Hk55m330jNiwxRodIlMCvw5iEyoRUCIY64W1p9D+tHc=
github.com/Morganamilo/go-srcinfo v1.0.0 h1:Wh4nEF+HJWo+29hnxM18Q2hi+DUf0GejS13+Wg+dzmI=
Expand All @@ -19,8 +17,6 @@ github.com/leonelquinteros/gotext v1.5.0 h1:ODY7LzLpZWWSJdAHnzhreOr6cwLXTAmc914F
github.com/leonelquinteros/gotext v1.5.0/go.mod h1:OCiUVHuhP9LGFBQ1oAmdtNCHJCiHiQA8lf4nAifHkr0=
github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4=
github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4=
Expand All @@ -36,8 +32,6 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM=
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a h1:ppl5mZgokTT8uPkmYOyEUmPTr3ypaKkg5eFOGrAmxxE=
golang.org/x/sys v0.0.0-20220204135822-1c1b9b1eba6a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY=
Expand Down

0 comments on commit dc9bef0

Please sign in to comment.