From b4348d8facbb724117e173eabdd087e22fe0a5ef Mon Sep 17 00:00:00 2001 From: Miguel de la Cruz Date: Fri, 30 Jun 2023 00:30:59 +0200 Subject: [PATCH] Add fmt check (with bad format to force a CI failure) --- .gitlab-ci.yml | 9 +++++++++ model/birthdays.go | 2 +- shell.nix | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c7a9ca1..3c5f50a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,16 @@ --- stages: + - format - test +check-fmt: + stage: format + image: nixos/nix:latest + script: + - nix-shell + - make fmt + - git diff --quiet + run-tests: stage: test image: nixos/nix:latest diff --git a/model/birthdays.go b/model/birthdays.go index c18b3f2..9c488a0 100644 --- a/model/birthdays.go +++ b/model/birthdays.go @@ -8,7 +8,7 @@ import ( type Birthday struct { Name string - Email string + Email string Phone string YearOfBirth int MonthOfBirth int diff --git a/shell.nix b/shell.nix index e141813..d501a7a 100644 --- a/shell.nix +++ b/shell.nix @@ -1,6 +1,7 @@ with import {}; mkShell { buildInputs = [ + git go gotestsum gnumake