diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..b3aa5cd --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,41 @@ +on: + push: + branches: [ "main" ] + pull_request: + branches: + - '**' + workflow_dispatch: {} + +name: Build +jobs: + test: + name: Test + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + #go-version: 'stable' + go-version-file: 'go.mod' + check-latest: true + id: go + + - name: Lint + run: | + go mod tidy + make fmt + make vet + #go get -u golang.org/x/lint/golint + #make lint + if: success() + + - name: Test + run: make test + if: success() + + - name: Build + run: go build -mod vendor ./... + if: success() diff --git a/.github/workflows/main.yaml b/.github/workflows/release.yaml similarity index 60% rename from .github/workflows/main.yaml rename to .github/workflows/release.yaml index ff0ea03..3ccaa26 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/release.yaml @@ -1,52 +1,18 @@ on: push: - branches: - - '**' tags: - 'v*' #tag-ignore: # - 'v*' workflow_dispatch: {} -name: aws-utils +name: Release jobs: - test: - name: Test - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up Go 1.x - uses: actions/setup-go@v5 - with: - #go-version: 'stable' - go-version-file: 'go.mod' - check-latest: true - id: go - - - name: Lint - run: | - go mod tidy - make fmt - make vet - #go get -u golang.org/x/lint/golint - #make lint - if: success() - - - name: Test - run: make test - if: success() - - - name: Build - run: go build -mod vendor ./... - if: success() - release: if: startsWith(github.ref, 'refs/tags/v') name: Release runs-on: ubuntu-latest - needs: [ test ] + #needs: [ test ] steps: - name: Checkout uses: actions/checkout@v4 @@ -56,7 +22,7 @@ jobs: #- name: Unshallow # run: git fetch --prune --unshallow - - name: Set up Go 1.x + - name: Set up Go uses: actions/setup-go@v5 with: go-version-file: 'go.mod'