From d24e756d3b53969535879e956554cac1cd18781c Mon Sep 17 00:00:00 2001 From: wendellast Date: Sun, 23 Feb 2025 13:36:02 -0300 Subject: [PATCH 1/3] test ci --- cmd/cpf/cpf_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/cpf/cpf_test.go b/cmd/cpf/cpf_test.go index bcb9ff4..bb835f7 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", "11121111111", ErrAllSameDigits}, {"Invalid CPF", "12345678900", ErrInvalidCPF}, } From 4eb4c338512582965993312f2cc80e6f020de384 Mon Sep 17 00:00:00 2001 From: wendellast Date: Sun, 23 Feb 2025 13:39:51 -0300 Subject: [PATCH 2/3] test ci --- .github/workflows/ci.yml | 34 ++++++++++++++++++++++++---------- cmd/cpf/cpf_test.go | 2 +- 2 files changed, 25 insertions(+), 11 deletions(-) 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/cmd/cpf/cpf_test.go b/cmd/cpf/cpf_test.go index bb835f7..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", "11121111111", ErrAllSameDigits}, + {"All same digits", "1111111111", ErrAllSameDigits}, {"Invalid CPF", "12345678900", ErrInvalidCPF}, } From 632b3fca2092f53ce9cc823a997a0f275253ecdc Mon Sep 17 00:00:00 2001 From: wendellast Date: Sun, 23 Feb 2025 13:43:50 -0300 Subject: [PATCH 3/3] test ci --- a | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 a diff --git a/a b/a new file mode 100644 index 0000000..e69de29