File tree Expand file tree Collapse file tree 7 files changed +65
-8
lines changed Expand file tree Collapse file tree 7 files changed +65
-8
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ name : Tests
3
+ on :
4
+ pull_request :
5
+ branches :
6
+ - main
7
+ push :
8
+ branches :
9
+ - main
10
+ permissions :
11
+ contents : read
12
+ jobs :
13
+ tests :
14
+ runs-on : ubuntu-latest
15
+ strategy :
16
+ fail-fast : false
17
+ matrix :
18
+ go-version : ['stable', 'oldstable']
19
+ env :
20
+ GOEXPERIMENT : cgocheck2
21
+ name : Go (${{ matrix.go-version }})
22
+ steps :
23
+ -
24
+ uses : actions/checkout@v4
25
+ -
26
+ uses : actions/setup-go@v5
27
+ with :
28
+ go-version : ${{ matrix.go-version }}
29
+ -
30
+ name : Fetch fswatch version
31
+ id : fswatch-version
32
+ env :
33
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
34
+ run : echo "version=$(gh release view --repo emcrisostomo/fswatch --json tagName --jq .tagName)" >> "$GITHUB_OUTPUT"
35
+ -
36
+ name : Cache libfswatch
37
+ id : libfswatch
38
+ uses : actions/cache@v4
39
+ with :
40
+ path : fswatch/target
41
+ key : ${{ runner.os }}-${{ steps.fswatch-version.outputs.version }}-fswatch
42
+ -
43
+ name : Compile libfswatch
44
+ if : steps.libfswatch.outputs.cache-hit != 'true'
45
+ env :
46
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
47
+ run : |
48
+ mkdir fswatch/
49
+ gh release download "${{ steps.fswatch-version.outputs.version }}" --repo emcrisostomo/fswatch --pattern 'fswatch-*.tar.gz' --output - | tar -x -C fswatch --strip-components=1
50
+ cd fswatch/
51
+ ./configure --prefix=$(pwd)/target
52
+ make -j"$(getconf _NPROCESSORS_ONLN)"
53
+ make install
54
+ -
55
+ name : Run tests
56
+ env :
57
+ PKG_CONFIG_PATH : ${{ github.workspace }}/fswatch/target/lib/pkgconfig
58
+ run : go test
Original file line number Diff line number Diff line change 1
1
package fswatch
2
2
3
- // #include <libfswatch.h>
3
+ // #include <libfswatch/c/libfswatch .h>
4
4
import "C"
5
5
import "time"
6
6
Original file line number Diff line number Diff line change 1
1
package fswatch
2
2
3
- // #include <libfswatch.h>
3
+ // #include <libfswatch/c/libfswatch .h>
4
4
import "C"
5
5
6
6
type FilterType C.enum_fsw_filter_type
Original file line number Diff line number Diff line change 1
1
// Package fswatch provides bindings for libfswatch.
2
2
package fswatch
3
3
4
- // #cgo LDFLAGS: -L/usr/local/lib -lfswatch
5
- // #cgo CFLAGS: -I/usr/local/include/libfswatch/c
4
+ // #cgo pkg-config: libfswatch
6
5
// #include <stdint.h>
7
6
// #include <stdlib.h>
8
- // #include <libfswatch.h>
7
+ // #include <libfswatch/c/libfswatch .h>
9
8
// #include "fswatch.h"
10
9
import "C"
11
10
import (
Original file line number Diff line number Diff line change 1
- #include <libfswatch.h>
1
+ #include <libfswatch/c/libfswatch .h>
2
2
3
3
void process_events (fsw_cevent const * const events ,
4
4
const unsigned int event_num , void * data );
Original file line number Diff line number Diff line change 1
1
package fswatch
2
2
3
- // #include <libfswatch.h>
3
+ // #include <libfswatch/c/libfswatch .h>
4
4
import "C"
5
5
6
6
type MonitorType C.enum_fsw_monitor_type
Original file line number Diff line number Diff line change 1
1
package fswatch
2
2
3
3
// #include <stdlib.h>
4
- // #include <libfswatch.h>
4
+ // #include <libfswatch/c/libfswatch .h>
5
5
import "C"
6
6
7
7
// Option instances allow to configure monitors.
You can’t perform that action at this time.
0 commit comments