Sfoglia il codice sorgente

More CI updates

tags/v2.1.8^2
9seconds 2 mesi fa
parent
commit
130b02013b
1 ha cambiato i file con 39 aggiunte e 72 eliminazioni
  1. 39
    72
      .github/workflows/ci.yaml

+ 39
- 72
.github/workflows/ci.yaml Vedi File

@@ -39,30 +39,17 @@ jobs:
39 39
     name: Test
40 40
     runs-on: ubuntu-latest
41 41
     timeout-minutes: 10
42
-    strategy:
43
-      matrix:
44
-        go_version:
45
-          - ^1.25
46 42
     steps:
47 43
       - name: Checkout
48 44
         uses: actions/checkout@v6
49 45
         with:
50 46
           submodules: recursive
51 47
 
52
-      - name: Setup Go
53
-        uses: actions/setup-go@v6
54
-        with:
55
-          go-version: ${{ matrix.go_version }}
56
-
57
-      - name: Cache dependencies
58
-        uses: actions/cache@v5
59
-        with:
60
-          path: ~/go/pkg/mod
61
-          key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
62
-          restore-keys: ${{ runner.os }}-go-
48
+      - uses: jdx/mise-action@v3
49
+        name: Install mise
63 50
 
64 51
       - name: Run tests
65
-        run: go test -coverprofile=./coverage.txt -covermode=atomic -v ./...
52
+        run: mise tasks run covtest
66 53
 
67 54
       - name: Collect coverage
68 55
         uses: codecov/codecov-action@v5
@@ -79,29 +66,11 @@ jobs:
79 66
         with:
80 67
           submodules: recursive
81 68
 
82
-      - name: Setup Go
83
-        uses: actions/setup-go@v6
84
-        with:
85
-          go-version: ^1.25
86
-
87
-      - name: Cache fuzz results
88
-        uses: actions/cache@v5
89
-        with:
90
-          path: ~/.cache/go-build/fuzz
91
-          key: ${{ runner.os }}-go-${{ hashFiles('**/*_fuzz_test.go', '**/*_fuzz_internal_test.go') }}
92
-          restore-keys: ${{ runner.os }}-go-
93
-
94
-      - name: Cache dependencies
95
-        uses: actions/cache@v5
96
-        with:
97
-          path: ~/go/pkg/mod
98
-          key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
99
-          restore-keys: ${{ runner.os }}-go-
100
-
101 69
       - uses: jdx/mise-action@v3
102 70
         name: Install mise
103 71
 
104
-      - run: mise tasks run 'test:fuzz:*'
72
+      - name: Run fuzzing
73
+        run: mise tasks run 'test:fuzz:*'
105 74
 
106 75
 
107 76
   lint:
@@ -114,13 +83,11 @@ jobs:
114 83
         with:
115 84
           submodules: recursive
116 85
 
117
-      - name: Setup Go
118
-        uses: actions/setup-go@v6
119
-        with:
120
-          go-version: ^1.25
86
+      - uses: jdx/mise-action@v3
87
+        name: Install mise
121 88
 
122 89
       - name: Run linter
123
-        uses: golangci/golangci-lint-action@v9.2.0
90
+        run: mise tasks run lint
124 91
 
125 92
   docker:
126 93
     name: Docker
@@ -133,17 +100,17 @@ jobs:
133 100
           submodules: recursive
134 101
 
135 102
       - name: Get Docker meta
136
-        id: docker_meta
137
-        uses: crazy-max/ghaction-docker-meta@v1
103
+        id: meta
104
+        uses: docker/metadata-action@v5
138 105
         with:
139 106
           images: nineseconds/mtg,ghcr.io/9seconds/mtg
140 107
           tag-semver: "{{version}},{{major}},{{major}}.{{minor}}"
141 108
 
142 109
       - name: Setup QEMU
143
-        uses: docker/setup-qemu-action@v1
110
+        uses: docker/setup-qemu-action@v3
144 111
 
145 112
       - name: Setup BuildX
146
-        uses: docker/setup-buildx-action@v1
113
+        uses: docker/setup-buildx-action@v3
147 114
 
148 115
       - name: Setup cache
149 116
         uses: actions/cache@v5
@@ -152,30 +119,30 @@ jobs:
152 119
           key: ${{ runner.os }}-buildx-${{ github.sha }}
153 120
           restore-keys: |
154 121
             ${{ runner.os }}-buildx-
155
-      #
156
-      # - name: Login to DockerHub
157
-      #   if: github.event_name != 'pull_request'
158
-      #   uses: docker/login-action@v1
159
-      #   with:
160
-      #     username: ${{ secrets.DOCKERHUB_USERNAME }}
161
-      #     password: ${{ secrets.DOCKERHUB_PASSWORD }}
162
-      #
163
-      # - name: Login to GHCR.io
164
-      #   if: github.event_name != 'pull_request'
165
-      #   uses: docker/login-action@v1
166
-      #   with:
167
-      #     registry: ghcr.io
168
-      #     username: ${{ github.repository_owner }}
169
-      #     password: ${{ secrets.GH_PAT }}
170
-      #
171
-      # - name: Build and push
172
-      #   uses: docker/build-push-action@v2
173
-      #   with:
174
-      #     pull: true
175
-      #     context: .
176
-      #     platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7,linux/arm/v6
177
-      #     push: ${{ github.event_name != 'pull_request' }}
178
-      #     tags: ${{ steps.docker_meta.outputs.tags }}
179
-      #     labels: ${{ steps.docker_meta.outputs.labels }}
180
-      #     cache-from: type=local,src=/tmp/buildx-cache
181
-      #     cache-to: type=local,dest=/tmp/buildx-cache
122
+
123
+      - name: Login to GHCR.io
124
+        if: github.event_name != 'pull_request'
125
+        uses: docker/login-action@v3
126
+        with:
127
+          registry: ghcr.io
128
+          username: ${{ github.repository_owner }}
129
+          password: ${{ secrets.GH_PAT }}
130
+
131
+      - name: Login to DockerHub
132
+        if: github.event_name != 'pull_request'
133
+        uses: docker/login-action@v3
134
+        with:
135
+          username: ${{ secrets.DOCKERHUB_USERNAME }}
136
+          password: ${{ secrets.DOCKERHUB_PASSWORD }}
137
+
138
+      - name: Build and push
139
+        uses: docker/build-push-action@v2
140
+        with:
141
+          pull: true
142
+          context: .
143
+          platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7,linux/arm/v6
144
+          push: false
145
+          tags: ${{ steps.docker_meta.outputs.tags }}
146
+          labels: ${{ steps.docker_meta.outputs.labels }}
147
+          cache-from: type=local,src=/tmp/buildx-cache
148
+          cache-to: type=local,dest=/tmp/buildx-cache

Loading…
Annulla
Salva