Skip to content

Commit

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

- name: Cache Go modules
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/go/cache
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
key: ${{ runner.os }}-go-${{ hashFiles('server/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
Expand All @@ -37,13 +37,16 @@ jobs:
run: go mod download

- name: Run vet
working-directory: server
run: go vet ./...

- name: Run tests
working-directory: server
run: go test -v ./...

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

lint:
runs-on: ubuntu-latest
Expand All @@ -55,12 +58,13 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
go-version: '1.22'

- 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 golangci-lint
working-directory: server
run: golangci-lint run ./...

release:
Expand All @@ -74,15 +78,16 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: 'go.mod'
go-version: '1.22'

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

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

0 comments on commit 02dd0c8

Please sign in to comment.