name: Functional tests with sqlite on: workflow_call: jobs: build: name: "Build + tests" runs-on: ubuntu-latest timeout-minutes: 20 steps: - name: "Force machineid" run: | sudo chmod +w /etc/machine-id echo githubciXXXXXXXXXXXXXXXXXXXXXXXX | sudo tee /etc/machine-id - name: "Set up Go 1.17" uses: actions/setup-go@v3 with: go-version: 1.17 id: go - name: "Clone CrowdSec" uses: actions/checkout@v3 with: fetch-depth: 0 submodules: true - name: "Install bats dependencies" run: | sudo apt install -y -qq build-essential daemonize jq netcat-openbsd GO111MODULE=on go get github.com/mikefarah/yq/v4 sudo cp -u ~/go/bin/yq /usr/local/bin/ go install github.com/wadey/gocovmerge@latest sudo cp -u ~/go/bin/gocovmerge /usr/local/bin/ - name: "Build crowdsec and fixture" run: TEST_COVERAGE=true make bats-clean bats-build bats-fixture - name: "Run tests" run: | TEST_COVERAGE=true make bats-test bzip2 ./tests/local/var/lib/coverage/coverage-bats.out - name: "Coverage report artifact" uses: actions/upload-artifact@v2 with: name: coverage-bats.out.bz2 path: ./tests/local/var/lib/coverage/coverage-bats.out.bz2 - name: "Show crowdsec logs" run: for file in $(find ./tests/local/var/log -type f); do echo ">>>>> $file"; cat $file; echo; done if: ${{ always() }}