-
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (59 loc) · 1.69 KB
/
tests.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
name: Tests
on:
pull_request:
branches:
- main
push:
branches:
- main
permissions:
contents: read
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go-version: ['stable', 'oldstable']
env:
GOEXPERIMENT: cgocheck2
name: Go (${{ matrix.go-version }})
steps:
-
uses: actions/checkout@v4
-
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
-
name: Fetch fswatch version
id: fswatch-version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: echo "version=$(gh release view --repo emcrisostomo/fswatch --json tagName --jq .tagName)" >> "$GITHUB_OUTPUT"
-
name: Cache libfswatch
id: libfswatch
uses: actions/cache@v4
with:
path: fswatch/target
key: ${{ runner.os }}-${{ steps.fswatch-version.outputs.version }}-fswatch
-
name: Compile libfswatch
if: steps.libfswatch.outputs.cache-hit != 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mkdir fswatch/
gh release download "${{ steps.fswatch-version.outputs.version }}" --repo emcrisostomo/fswatch --pattern 'fswatch-*.tar.gz' --output - | tar -xz -C fswatch --strip-components=1
cd fswatch/
./configure --prefix=$(pwd)/target
make -j"$(getconf _NPROCESSORS_ONLN)"
make install
-
name: Run tests
env:
PKG_CONFIG_PATH: ${{ github.workspace }}/fswatch/target/lib/pkgconfig
LD_LIBRARY_PATH: ${{ github.workspace }}/fswatch/target/lib
run: go test -race