Skip to content

Commit

Permalink
chore: fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Ehco1996 committed Oct 11, 2023
1 parent c807972 commit 0a2d103
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 10 deletions.
13 changes: 4 additions & 9 deletions .github/workflows/ci.yml → .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: normal
name: build-image

on:
push:
Expand All @@ -8,13 +8,8 @@ on:
- "cmd/**"
- "internal/**"
- "pkg/**"
pull_request:
branches:
- master
paths:
- "cmd/**"
- "internal/**"
- "pkg/**"
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -71,7 +66,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
tags: "ehco1996/ehco:latest"
tags: "ehco1996/ehco:latest,ehco1996/ehco:${{ github.sha }}"
push: true
file: build/Dockerfile
platforms: linux/amd64,linux/arm64
50 changes: 50 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: check-code

on:
push:
branches:
- master
paths:
- "cmd/**"
- "internal/**"
- "pkg/**"
pull_request:
branches:
- master
paths:
- "cmd/**"
- "internal/**"
- "pkg/**"
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: "1.21"
id: go

- uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Check out code into the Go module directory
uses: actions/checkout@v1

- name: tidy
run: make tidy

- name: lint
run: make lint

- name: test
run: make test

- name: build
run: make build
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml → .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: go-releaser
name: release-tag

on:
push:
Expand Down

0 comments on commit 0a2d103

Please sign in to comment.