Skip to content

Commit f87923f

Browse files
committed
Add go.mod and CI/CD
1 parent 9512f69 commit f87923f

File tree

3 files changed

+105
-0
lines changed

3 files changed

+105
-0
lines changed

.github/workflows/ci.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master, main ]
6+
pull_request:
7+
branches: [ master, main ]
8+
9+
jobs:
10+
test:
11+
name: Test
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, macos-latest, windows-latest]
16+
go-version: ['1.22', '1.23']
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Set up Go
23+
uses: actions/setup-go@v5
24+
with:
25+
go-version: ${{ matrix.go-version }}
26+
27+
- name: Download dependencies
28+
run: go mod download
29+
30+
- name: Run go vet
31+
run: go vet ./...
32+
33+
- name: Check formatting
34+
if: matrix.os == 'ubuntu-latest'
35+
run: |
36+
if [ -n "$(gofmt -l .)" ]; then
37+
echo "The following files are not formatted:"
38+
gofmt -l .
39+
exit 1
40+
fi
41+
42+
- name: Run tests
43+
run: go test -v -race -timeout=10m ./...
44+
45+
- name: Run tests with coverage
46+
if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.23'
47+
run: go test -v -race -coverprofile=coverage.out -covermode=atomic ./...
48+
49+
- name: Upload coverage to Codecov
50+
if: matrix.os == 'ubuntu-latest' && matrix.go-version == '1.23'
51+
uses: codecov/codecov-action@v4
52+
with:
53+
files: ./coverage.out
54+
flags: unittests
55+
name: codecov-umbrella
56+
fail_ci_if_error: false
57+
58+
build:
59+
name: Build
60+
runs-on: ubuntu-latest
61+
62+
steps:
63+
- name: Checkout code
64+
uses: actions/checkout@v4
65+
66+
- name: Set up Go
67+
uses: actions/setup-go@v5
68+
with:
69+
go-version: '1.23'
70+
71+
- name: Build
72+
run: go build -v ./...

go.mod

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module github.com/absfs/httpfs
2+
3+
go 1.25.4
4+
5+
require (
6+
github.com/absfs/absfs v0.0.0-20251109181304-77e2f9ac4448
7+
github.com/absfs/memfs v0.0.0-20251122223403-0826c6ce3884
8+
github.com/pkg/errors v0.9.1
9+
)
10+
11+
require github.com/absfs/inode v0.0.0-20190804195220-b7cd14cdd0dc // indirect

go.sum

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
github.com/absfs/absfs v0.0.0-20251109181304-77e2f9ac4448 h1:uN3Q47kmtV6TIGHZbrCbCf68jWmYDWyTcqq5JuoyON4=
2+
github.com/absfs/absfs v0.0.0-20251109181304-77e2f9ac4448/go.mod h1:IvFD36FQcMxLLZNhs2Lms+Uosc0G3AJ2JHOJIz8E5d8=
3+
github.com/absfs/fstesting v0.0.0-20180810212821-8b575cdeb80d h1:EVkAQkoP/iYX7WpkSgaSkHr5AgDdzxR06Hmy+bu4YpU=
4+
github.com/absfs/fstesting v0.0.0-20180810212821-8b575cdeb80d/go.mod h1:Ib9xUBFJeggV+KCP6/90/ymnt4Siu6V1vBFJrrT1y/s=
5+
github.com/absfs/inode v0.0.0-20190804195220-b7cd14cdd0dc h1:KjciuTgBUzV6RfeVLd/Ijhy9Iq7z0JoJ44te3fZaaNE=
6+
github.com/absfs/inode v0.0.0-20190804195220-b7cd14cdd0dc/go.mod h1:lc9vQxyCSyrjclBTgazRvacmElJLj7VfpDmgDnL77o0=
7+
github.com/absfs/memfs v0.0.0-20251122223403-0826c6ce3884 h1:A2+eVMTuCed7SIxqGvWchjKoOHHIFD0An771dYDejqQ=
8+
github.com/absfs/memfs v0.0.0-20251122223403-0826c6ce3884/go.mod h1:ITY8mYr6yHK7ZTNblu5zQk33tMIRaJhoa+YX8/talDk=
9+
github.com/absfs/osfs v0.0.0-20220705103527-80b6215cf130 h1:kehuUUalOBgwPkBRRW7/hX7b6VeB4Ed0iKX2z2wwqQA=
10+
github.com/absfs/osfs v0.0.0-20220705103527-80b6215cf130/go.mod h1:IIzwVILCbb3j0VHjcAQ7Xwpdz1h57eUzZil7DCIel/c=
11+
github.com/fatih/color v1.12.0 h1:mRhaKNwANqRgUBGKmnI5ZxEk7QXmjQeCcuYFMX2bfcc=
12+
github.com/fatih/color v1.12.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
13+
github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8=
14+
github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
15+
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
16+
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
17+
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
18+
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
19+
github.com/xtgo/set v1.0.0 h1:6BCNBRv3ORNDQ7fyoJXRv+tstJz3m1JVFQErfeZz2pY=
20+
github.com/xtgo/set v1.0.0/go.mod h1:d3NHzGzSa0NmB2NhFyECA+QdRp29oEn2xbT+TpeFoM8=
21+
golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
22+
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=

0 commit comments

Comments
 (0)