From 02dd0c8d7d6f70c82755137746da80156974decc Mon Sep 17 00:00:00 2001 From: "zackari sl." Date: Sun, 4 Aug 2024 00:05:44 +0100 Subject: [PATCH] tweaking the github action file --- .github/workflows/cicd.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 65ea322..73ea245 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -20,7 +20,7 @@ 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 @@ -28,7 +28,7 @@ jobs: 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- @@ -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 @@ -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: @@ -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 }}