Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 24 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,47 @@
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 ./...

test:
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 ./...
run: go mod tidy && go mod download

- name: Run tests
run: go test -v ./...
Empty file added a
Empty file.
2 changes: 1 addition & 1 deletion cmd/cpf/cpf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
}

Expand Down