File tree 3 files changed +44
-3
lines changed
3 files changed +44
-3
lines changed Original file line number Diff line number Diff line change
1
+ name : Code Coverage
2
+
3
+ on : [push]
4
+
5
+ jobs :
6
+ coverage :
7
+ runs-on : " ubuntu-20.04"
8
+ name : Coverage
9
+ steps :
10
+ - uses : actions/checkout@v4
11
+ with :
12
+ fetch-depth : 0
13
+ - name : Install Nix
14
+ uses : cachix/install-nix-action@v30
15
+ with :
16
+ extra_nix_config : |
17
+ accept-flake-config = true
18
+ experimental-features = nix-command flakes
19
+ - name : Run coverage
20
+ run : nix build .#treefmt.tests.coverage
21
+ - name : Upload coverage
22
+ uses : coverallsapp/github-action@v2
23
+ with :
24
+ github-token : ${{ secrets.github_token }}
25
+ file : result
26
+ format : golang
Original file line number Diff line number Diff line change 6
6
7
7
** One CLI to format your repo**
8
8
9
- * A <a href =" https://numtide.com/ " >numtide</a > project.*
9
+ _ A <a href =" https://numtide.com/ " >numtide</a > project._
10
10
11
11
<p >
12
+ <a href =' https://coveralls.io/github/numtide/treefmt?branch=new-README ' ><img src =' https://coveralls.io/repos/github/numtide/treefmt/badge.svg?branch=new-README ' alt =' Coverage Status ' /></a >
12
13
<a href =" https://github.com/numtide/treefmt/actions/workflows/release.yml " ><img src =" https://github.com/numtide/treefmt/actions/workflows/release.yml/badge.svg " /></a >
13
14
<img alt =" Static Badge " src =" https://img.shields.io/badge/status-beta-yellow " >
14
15
<a href =" https://app.element.io/#/room/#home:numtide.com " ><img src =" https://img.shields.io/badge/Support-%23numtide-blue " /></a >
Original file line number Diff line number Diff line change 63
63
git config --global user.name "Treefmt Test"
64
64
'' ;
65
65
66
- passthru . tests = {
67
- golangci-lint = perSystem . self . treefmt . overrideAttrs ( old : {
66
+ passthru . tests = let
67
+ inherit ( perSystem . self ) treefmt ;
68
+ in {
69
+ coverage = lib . optionalAttrs pkgs . stdenv . isx86_64 ( treefmt . overrideAttrs ( old : {
70
+ nativeBuildInputs = old . nativeBuildInputs ++ [ pkgs . gcc ] ;
71
+ CGO_ENABLED = 1 ;
72
+ buildPhase = ''
73
+ HOME=$TMPDIR
74
+ go test -race -covermode=atomic -coverprofile=coverage.out -v ./...
75
+ '' ;
76
+ installPhase = ''
77
+ mv coverage.out $out
78
+ '' ;
79
+ } ) ) ;
80
+
81
+ golangci-lint = treefmt . overrideAttrs ( old : {
68
82
nativeBuildInputs = old . nativeBuildInputs ++ [ pkgs . golangci-lint ] ;
69
83
buildPhase = ''
70
84
HOME=$TMPDIR
You can’t perform that action at this time.
0 commit comments