* github-ci: color unit test output and logs * new config option: force_color_logs (useful in CI) * bats: show sqlite/mysql dump at the end * removed "-v" (print package names) from "go build" * general workflow cleanup
104 lines
3.1 KiB
YAML
104 lines
3.1 KiB
YAML
# .github/workflows/build-docker-image.yml
|
|
name: build
|
|
|
|
on:
|
|
release:
|
|
types: prereleased
|
|
|
|
jobs:
|
|
build:
|
|
name: Build and upload binary package
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Set up Go 1.17
|
|
uses: actions/setup-go@v3
|
|
with:
|
|
go-version: 1.17
|
|
id: go
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v3
|
|
- name: Build the binaries
|
|
run: make release
|
|
- name: Upload to release
|
|
uses: JasonEtco/upload-to-release@master
|
|
with:
|
|
args: crowdsec-release.tgz application/x-gzip
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
build_static:
|
|
name: Build and upload binary package
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Set up Go 1.17
|
|
uses: actions/setup-go@v1
|
|
with:
|
|
go-version: 1.17
|
|
id: go
|
|
- name: Check out code into the Go module directory
|
|
uses: actions/checkout@v3
|
|
- name: Build the binaries
|
|
run: make release_static
|
|
- name: Upload to release
|
|
uses: JasonEtco/upload-to-release@master
|
|
with:
|
|
args: crowdsec-release-static.tgz application/x-gzip
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
test_tarball:
|
|
strategy:
|
|
matrix:
|
|
tarball:
|
|
- name: crowdsec-release
|
|
- name: crowdsec-release-static
|
|
name: Download tarball and run functional tests
|
|
runs-on: ubuntu-20.04
|
|
needs: [build, build_static]
|
|
steps:
|
|
- id: fetch_prerelease_version
|
|
uses: pozetroninc/github-action-get-latest-release@master
|
|
with:
|
|
repository: crowdsecurity/crowdsec
|
|
excludes: draft
|
|
- name: download tarball
|
|
run: wget -qO - https://github.com/crowdsecurity/crowdsec/releases/download/${{ steps.fetch_prerelease_version.outputs.release }}/${{ matrix.tarball.name }}.tgz | tar xvzf -
|
|
- name: "Force machineid"
|
|
run: |
|
|
sudo chmod +w /etc/machine-id
|
|
echo githubciXXXXXXXXXXXXXXXXXXXXXXXX | sudo tee /etc/machine-id
|
|
- name: Install release
|
|
run: |
|
|
cd crowdsec-${{ steps.fetch_prerelease_version.outputs.release }}
|
|
sudo ./wizard.sh --unattended
|
|
- name: Check out code to get functional tests scripts
|
|
uses: actions/checkout@v3
|
|
- name: "Test post-install base"
|
|
run: |
|
|
cd scripts/func_tests/
|
|
./tests_post-install_0base.sh
|
|
- name: "Test post-install bouncer"
|
|
run: |
|
|
cd scripts/func_tests/
|
|
./tests_post-install_1bouncers.sh
|
|
- name: "Test post-install collections"
|
|
run: |
|
|
cd scripts/func_tests/
|
|
./tests_post-install_2collections.sh
|
|
- name: "Test post-install macines"
|
|
run: |
|
|
cd scripts/func_tests/
|
|
./tests_post-install_3machines.sh
|
|
- name: "Test post-install ip management"
|
|
run: |
|
|
cd scripts/func_tests/
|
|
./tests_post-install_99ip_mgmt.sh
|
|
- name: "Test cold logs"
|
|
run: |
|
|
cd scripts/func_tests/
|
|
./tests_post-install_4cold-logs.sh
|
|
- name: "Uninstall"
|
|
run: sudo ./wizard.sh --uninstall
|
|
- name: "Test post remove"
|
|
run: |
|
|
cd scripts/func_tests/
|
|
bash -x ./tests_post-remove_0base.sh
|