9seconds 2 месяцев назад
Родитель
Сommit
130b02013b
1 измененных файлов: 39 добавлений и 72 удалений
  1. 39
    72
      .github/workflows/ci.yaml

+ 39
- 72
.github/workflows/ci.yaml Просмотреть файл

39
     name: Test
39
     name: Test
40
     runs-on: ubuntu-latest
40
     runs-on: ubuntu-latest
41
     timeout-minutes: 10
41
     timeout-minutes: 10
42
-    strategy:
43
-      matrix:
44
-        go_version:
45
-          - ^1.25
46
     steps:
42
     steps:
47
       - name: Checkout
43
       - name: Checkout
48
         uses: actions/checkout@v6
44
         uses: actions/checkout@v6
49
         with:
45
         with:
50
           submodules: recursive
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
       - name: Run tests
51
       - name: Run tests
65
-        run: go test -coverprofile=./coverage.txt -covermode=atomic -v ./...
52
+        run: mise tasks run covtest
66
 
53
 
67
       - name: Collect coverage
54
       - name: Collect coverage
68
         uses: codecov/codecov-action@v5
55
         uses: codecov/codecov-action@v5
79
         with:
66
         with:
80
           submodules: recursive
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
       - uses: jdx/mise-action@v3
69
       - uses: jdx/mise-action@v3
102
         name: Install mise
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
   lint:
76
   lint:
114
         with:
83
         with:
115
           submodules: recursive
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
       - name: Run linter
89
       - name: Run linter
123
-        uses: golangci/golangci-lint-action@v9.2.0
90
+        run: mise tasks run lint
124
 
91
 
125
   docker:
92
   docker:
126
     name: Docker
93
     name: Docker
133
           submodules: recursive
100
           submodules: recursive
134
 
101
 
135
       - name: Get Docker meta
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
         with:
105
         with:
139
           images: nineseconds/mtg,ghcr.io/9seconds/mtg
106
           images: nineseconds/mtg,ghcr.io/9seconds/mtg
140
           tag-semver: "{{version}},{{major}},{{major}}.{{minor}}"
107
           tag-semver: "{{version}},{{major}},{{major}}.{{minor}}"
141
 
108
 
142
       - name: Setup QEMU
109
       - name: Setup QEMU
143
-        uses: docker/setup-qemu-action@v1
110
+        uses: docker/setup-qemu-action@v3
144
 
111
 
145
       - name: Setup BuildX
112
       - name: Setup BuildX
146
-        uses: docker/setup-buildx-action@v1
113
+        uses: docker/setup-buildx-action@v3
147
 
114
 
148
       - name: Setup cache
115
       - name: Setup cache
149
         uses: actions/cache@v5
116
         uses: actions/cache@v5
152
           key: ${{ runner.os }}-buildx-${{ github.sha }}
119
           key: ${{ runner.os }}-buildx-${{ github.sha }}
153
           restore-keys: |
120
           restore-keys: |
154
             ${{ runner.os }}-buildx-
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

Загрузка…
Отмена
Сохранить