From b3b069eae19ee43c9b61b6cb0b1976f1dc5a5802 Mon Sep 17 00:00:00 2001 From: koki-develop Date: Wed, 6 Mar 2024 06:54:17 +0900 Subject: [PATCH] Create ci workflow --- .github/actions/setup/action.yml | 9 ++++++++ .github/workflows/ci.yml | 35 ++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 .github/actions/setup/action.yml create mode 100644 .github/workflows/ci.yml diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml new file mode 100644 index 0000000..42345bd --- /dev/null +++ b/.github/actions/setup/action.yml @@ -0,0 +1,9 @@ +name: Setup + +runs: + using: composite + steps: + - uses: actions/setup-go@v4 + with: + go-version-file: go.mod + cache: true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..82929ad --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,35 @@ +name: ci + +on: + push: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup + uses: ./.github/actions/setup + - name: Test + run: go test ./... -race -coverprofile=coverage.out -covermode=atomic + + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup + uses: ./.github/actions/setup + - name: Build + run: go build . + + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup + uses: ./.github/actions/setup + - name: Lint + uses: golangci/golangci-lint-action@v4