diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e1730c..bdb08e4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,20 +1,29 @@ -name: Go +name: Go CI + on: pull_request: branches: [ "main" ] - types: [opened] + types: [ opened ] jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - name: Checkout repository + uses: actions/checkout@v4 + - name: Setup Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v4 with: go-version: '1.23.x' + cache: true + - name: Install dependencies - run: go get . + run: go mod tidy && go mod download + + - name: Static analysis + run: go vet ./... + - name: Build run: go build -v ./... @@ -22,12 +31,17 @@ jobs: runs-on: ubuntu-latest needs: build steps: - - uses: actions/checkout@v2 + - name: Checkout repository + uses: actions/checkout@v4 + - name: Setup Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v4 with: go-version: '1.23.x' + cache: true + - name: Install dependencies - run: go get . - - name: Test with the Go CLI - run: go test ./... \ No newline at end of file + run: go mod tidy && go mod download + + - name: Run tests + run: go test -v ./... diff --git a/a b/a new file mode 100644 index 0000000..e69de29 diff --git a/cmd/cpf/cpf_test.go b/cmd/cpf/cpf_test.go index bcb9ff4..ecd71d8 100644 --- a/cmd/cpf/cpf_test.go +++ b/cmd/cpf/cpf_test.go @@ -12,7 +12,7 @@ func TestIsValid(t *testing.T) { }{ {"Valid CPF", "12345678909", nil}, {"Invalid length", "1234567890", ErrInvalidLen}, - {"All same digits", "11111111111", ErrAllSameDigits}, + {"All same digits", "1111111111", ErrAllSameDigits}, {"Invalid CPF", "12345678900", ErrInvalidCPF}, }