diff --git a/.github/workflows/builder-image.yml b/.github/workflows/builder-image.yml new file mode 100644 index 00000000..69b30356 --- /dev/null +++ b/.github/workflows/builder-image.yml @@ -0,0 +1,24 @@ +name: Builder image + +on: + schedule: + - cron: "0 3 * * 1" + push: + paths: + - "ci.Dockerfile" + - "**/builder-image.yml" +jobs: + build: + name: Push builder image to GitHub Packages + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v2 + - name: Push to GitHub Packages + uses: docker/build-push-action@v1 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + repository: jguer/yay-builder + dockerfile: ci.Dockerfile + tags: latest diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 37fe4741..3128e56f 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -15,7 +15,7 @@ jobs: name: Lint and test yay runs-on: ubuntu-latest container: - image: samip537/archlinux:devel + image: jguer/yay-builder:latest steps: - name: Checkout uses: actions/checkout@v2 @@ -25,9 +25,7 @@ jobs: key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go- - - name: Run Build and tests - run: | - pacman -Sy --noconfirm go - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.27.0 - ./bin/golangci-lint run ./... - make test + - name: Lint + run: /app/bin/golangci-lint run ./... + - name: Run Build and Tests + run: make test diff --git a/ci.Dockerfile b/ci.Dockerfile new file mode 100644 index 00000000..d2ea3bd7 --- /dev/null +++ b/ci.Dockerfile @@ -0,0 +1,13 @@ +FROM lopsided/archlinux:devel +LABEL maintainer="Jguer,joaogg3 at google mail" + +ENV GO111MODULE=on +WORKDIR /app + +RUN pacman -Syu --overwrite=* --needed --noconfirm go git + +RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.30.0 + +COPY go.mod . + +RUN go mod download diff --git a/go.mod b/go.mod index 73c793c6..0de212e1 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.6.1 golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a - golang.org/x/sys v0.0.0-20200820212457-1fb795427249 // indirect + golang.org/x/sys v0.0.0-20200820212457-1fb795427249 gopkg.in/h2non/gock.v1 v1.0.15 gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect )