From fd428c7fee387d434f341e7a839449a1bbaa0908 Mon Sep 17 00:00:00 2001 From: Le Minh Tri Date: Thu, 1 Jun 2023 06:20:48 +0700 Subject: [PATCH] ci(action): use new GitHub Action to check the project --- .github/workflows/ci.yml | 31 +++++++++++++++++++++++++++++++ .github/workflows/go.yml | 40 ---------------------------------------- README.md | 2 +- 3 files changed, 32 insertions(+), 41 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/go.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7e57ceb --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,31 @@ +name: Go CI +on: + push: + tags: + - v* + branches: + - main + +permissions: + contents: read + +jobs: + check: + name: check + strategy: + matrix: + os: + - ubuntu-latest + - macos-latest + # - windows-latest + go-version: + - '1.18' + - '1.19' + - '1.20' + runs-on: ${{ matrix.os }} + steps: + - name: Run Go CI + uses: ghacts/go@main + with: + go-version: ${{ matrix.go-version }} + skip-build: true diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml deleted file mode 100644 index c8e787d..0000000 --- a/.github/workflows/go.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Go CI -on: - push: - tags: - - v* - branches: - - main - pull_request: -permissions: - contents: read - # Optional: allow read access to pull request. Use with `only-new-issues` option. - # pull-requests: read -jobs: - golangci: - strategy: - matrix: - os: - - ubuntu-latest - - macos-latest - # - windows-latest - go-version: ['1.18', '1.19', '1.20'] - name: lint - runs-on: ${{ matrix.os }} - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup Go environment - uses: actions/setup-go@v4 - with: - go-version: ${{ matrix.go-version }} - - - name: Run golangci-lint - uses: golangci/golangci-lint-action@v3 - with: - version: v1.52 - args: --timeout=3m - - - name: Test - run: go test -v ./... diff --git a/README.md b/README.md index 02fcf5f..3d0bed2 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # tar-xz [![Go Reference](https://pkg.go.dev/badge/github.com/ansidev/tar-xz.svg)](https://pkg.go.dev/github.com/ansidev/tar-xz) -[![Go CI](https://github.com/ansidev/tar-xz/actions/workflows/go.yml/badge.svg)](https://github.com/ansidev/tar-xz/actions/workflows/go.yml) +[![Go CI](https://github.com/ansidev/tar-xz/actions/workflows/ci.yml/badge.svg)](https://github.com/ansidev/tar-xz/actions/workflows/ci.yml) ## Introduction