1
0
mirror of https://github.com/Jguer/yay synced 2024-07-09 04:46:19 +00:00

Enable testing in ci builds

This commit is contained in:
Jguer 2019-10-22 10:32:14 +01:00
parent e1403861c0
commit d50ca0430b
No known key found for this signature in database
GPG Key ID: 6D6CC9BEA8556B35
3 changed files with 64 additions and 11 deletions

View File

@ -5,15 +5,17 @@ LABEL maintainer="Jguer,joaogg3 at google mail"
ENV GO111MODULE=on
WORKDIR /app
ADD ./testdata/ci/pacman.conf /etc/pacman.conf
RUN pacman -Syu --overwrite=* --needed --noconfirm \
gcc gnupg libldap go git tar make awk linux-api-headers pacman-contrib && paccache -rfk0
gcc gnupg libldap go git tar make awk linux-api-headers pacman pacman-contrib && paccache -rfk0
# Dependency for linting
RUN curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b /bin v1.20.0
RUN curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b /bin v1.20.0
RUN go get golang.org/x/lint/golint && mv /root/go/bin/golint /bin/
ENV ARCH=$BUILD_ARCH
ADD . .
COPY . .
FROM builder_env AS builder
@ -26,15 +28,15 @@ RUN pacman -Syu --overwrite=* --needed --noconfirm \
git base-devel awk pacman-contrib && paccache -rfk0
# Gracefully removed from https://github.com/Cognexa/dockerfiles/blob/master/dockerfiles/archlinux
RUN useradd -m -s /bin/bash aur \
&& passwd -d aur \
&& echo 'aur ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/aur \
&& echo 'Defaults env_keep += "EDITOR"' >> /etc/sudoers.d/aur
RUN useradd -m -s /bin/bash aur && \
passwd -d aur && \
echo 'aur ALL=(ALL) NOPASSWD: ALL' >/etc/sudoers.d/aur && \
echo 'Defaults env_keep += "EDITOR"' >>/etc/sudoers.d/aur
ENV EDITOR vim
# set UTF-8 locale
RUN echo 'en_US.UTF-8 UTF-8' > /etc/locale.gen && locale-gen
RUN echo 'en_US.UTF-8 UTF-8' >/etc/locale.gen && locale-gen
ENV LANG en_US.UTF-8
WORKDIR /work/

View File

@ -39,9 +39,6 @@ func TestConfig(t *testing.T) {
hook, err := h.HookDirs()
expect(t, "HookDir", []string{"/usr/share/libalpm/hooks/", "/hookdir/"}, hook.Slice(), err)
delta, err := h.DeltaRatio()
expect(t, "UseDelta", 0.5, delta, err)
arch, err := h.Arch()
expect(t, "Architecture", "8086", arch, err)

54
testdata/ci/pacman.conf vendored Normal file
View File

@ -0,0 +1,54 @@
#
# /etc/pacman.conf
#
# See the pacman.conf(5) manpage for option and repository directives
#
# GENERAL OPTIONS
#
[options]
# The following paths are commented out with their default values listed.
# If you wish to use different paths, uncomment and update the paths.
#RootDir = /
#DBPath = /var/lib/pacman/
#CacheDir = /var/cache/pacman/pkg/
#LogFile = /var/log/pacman.log
#GPGDir = /etc/pacman.d/gnupg/
#HookDir = /etc/pacman.d/hooks/
HoldPkg = pacman glibc
#XferCommand = /usr/bin/curl -L -C - -f -o %o %u
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled
Architecture = auto
# Pacman won't upgrade packages listed in IgnorePkg and members of IgnoreGroup
#IgnorePkg =
#IgnoreGroup =
#NoUpgrade =
#NoExtract =
# Misc options
#UseSyslog
#Color
#TotalDownload
CheckSpace
#VerbosePkgLists
SigLevel = Never
LocalFileSigLevel = Optional
[testing]
Include = /etc/pacman.d/mirrorlist
[core]
Include = /etc/pacman.d/mirrorlist
[extra]
Include = /etc/pacman.d/mirrorlist
[community-testing]
Include = /etc/pacman.d/mirrorlist
[community]
Include = /etc/pacman.d/mirrorlist