Add release pipeline with .deb and .rpm packaging #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: false # don't need sanoid reference in CI | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.26' | |
| - name: Build | |
| run: go build -o zvolta ./cmd/zvolta | |
| - name: Unit tests | |
| run: go test ./... | |
| - name: Install ZFS | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y zfsutils-linux | |
| sudo modprobe zfs | |
| - name: Create test pool | |
| run: sudo ./scripts/setup-test-pool.sh create | |
| - name: Integration tests | |
| run: sudo go test -tags=integration -count=1 ./... | |
| - name: Destroy test pool | |
| if: always() | |
| run: sudo ./scripts/setup-test-pool.sh destroy | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: false | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.26' | |
| - name: Vet | |
| run: go vet ./... |