Browse Source

fix(ci): fix CI issues

jguer 4 năm trước cách đây
mục cha
commit
8a0a0cf2bc
4 tập tin đã thay đổi với 43 bổ sung8 xóa
  1. 24 0
      .github/workflows/builder-image.yml
  2. 5 7
      .github/workflows/testing.yml
  3. 13 0
      ci.Dockerfile
  4. 1 1
      go.mod

+ 24 - 0
.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

+ 5 - 7
.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

+ 13 - 0
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

+ 1 - 1
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
 )