Browse Source

run test cases also on FreeBSD

Signed-off-by: Nicola Murino <[email protected]>
Nicola Murino 2 years ago
parent
commit
72e0325d05
2 changed files with 29 additions and 1 deletions
  1. 28 0
      .cirrus.yml
  2. 1 1
      README.md

+ 28 - 0
.cirrus.yml

@@ -0,0 +1,28 @@
+freebsd_task:
+  name: FreeBSD
+
+  matrix:
+    - name: FreeBSD 13.1
+      freebsd_instance:
+        image_family: freebsd-13-1
+
+  pkginstall_script:
+    - pkg update -f
+    - pkg install -y go
+
+  compile_script:
+    - go build -trimpath -tags nopgxregisterdefaulttypes -ldflags "-s -w -X github.com/drakkan/sftpgo/v2/internal/version.commit=`git describe --always --abbrev=8 --dirty` -X github.com/drakkan/sftpgo/v2/internal/version.date=`date -u +%FT%TZ`" -o sftpgo
+    - cd tests/eventsearcher && go build -trimpath -ldflags "-s -w" -o eventsearcher && cd -
+    - cd tests/ipfilter && go build -trimpath -ldflags "-s -w" -o ipfilter && cd -
+
+  setup_script:
+    - pw groupadd sftpgo
+    - pw useradd sftpgo -g sftpgo -w none -m
+    - cp -R . /home/sftpgo
+    - chown -R sftpgo:sftpgo /home/sftpgo
+
+  check_script:
+    - su sftpgo -c 'cd ~ && ./sftpgo initprovider && ./sftpgo resetprovider --force'
+
+  test_script:
+    - su sftpgo -c 'cd ~ && go test -v -tags nopgxregisterdefaulttypes -p 1 -timeout 20m ./... -coverprofile=coverage.txt -covermode=atomic'

+ 1 - 1
README.md

@@ -104,7 +104,7 @@ If you report an invalid issue or ask for step-by-step support, your issue will
 
 ## Platforms
 
-SFTPGo is developed and tested on Linux. After each commit, the code is automatically built and tested on Linux, macOS and Windows using [GitHub Actions](./.github/workflows/development.yml). The test cases are regularly manually executed and passed on FreeBSD. Other *BSD variants should work too.
+SFTPGo is developed and tested on Linux. After each commit, the code is automatically built and tested on Linux, macOS, Windows and FreeBSD. Other *BSD variants should work too.
 
 ## Requirements