Skip to content

Commit

Permalink
fixing github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
slzakaria committed Aug 3, 2024
1 parent 6b1ee02 commit e773b28
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.22'
go-version-file: '1.22'

- name: Cache Go modules
uses: actions/cache@v3
Expand All @@ -33,8 +33,12 @@ jobs:
${{ runner.os }}-go-
- name: Install dependencies
working-directory: server
run: go mod download

- name: Run vet
run: go vet ./...

- name: Run tests
run: go test -v ./...

Expand All @@ -51,17 +55,17 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.22'
go-version-file: 'go.mod'

- name: Install golint
run: go install golang.org/x/lint/golint@latest
- name: Install golangci-lint
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.2

- name: Run golint
run: golint ./...
- name: Run golangci-lint
run: golangci-lint run ./...

release:
runs-on: ubuntu-latest
needs: build-test
needs: [build-test, lint]
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Checkout code
Expand All @@ -70,15 +74,15 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.22'
go-version-file: 'go.mod'

- name: Build
run: go build -v ./...
run: go build -v -o myapp ./...

- name: Create Release
uses: softprops/action-gh-release@v1
if: success()
with:
files: ./your-binary
files: ./myapp
env:
GITHUB_TOKEN: ${{ secrets.PIPE_TOKEN }}

0 comments on commit e773b28

Please sign in to comment.