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