File: main.yml

package info (click to toggle)
golang-github-digitalocean-go-libvirt 0.0~git20250317.13bf9b4-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie, trixie-proposed-updates
  • size: 1,188 kB
  • sloc: yacc: 188; sh: 76; xml: 50; makefile: 3
file content (64 lines) | stat: -rw-r--r-- 1,741 bytes parent folder | download
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
60
61
62
63
64
name: CI

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

  # allow manual execution from the web interface
  workflow_dispatch:

jobs:
  test:
    strategy:
      matrix:
        os: ['ubuntu-20.04', 'ubuntu-22.04']
        toolchain: ['oldstable', 'stable']

    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v4 # respository path: $GITHUB_WORKSPACE
      - uses: actions/setup-go@v5
        with:
          go-version: ${{ matrix.toolchain }}

      - name: Install golint
        run: go install golang.org/x/lint/golint@latest
      - name: Install goyacc
        run: go install golang.org/x/tools/cmd/goyacc@latest

      - name: Install libvirt
        run: |
          sudo apt-get update
          sudo apt-get -qqy install libvirt-daemon-system

      - name: Stop libvirtd
        run: sudo systemctl stop libvirtd
      - name: Start libvirtd with custom config
        run: sudo libvirtd -d -l -f $GITHUB_WORKSPACE/.github/workflows/libvirtd.conf

      - name: Setup test artifacts
        env:
          TESTDATA: ${{ github.workspace }}/testdata
        run: |
          go get -d ./...
          sudo qemu-img create -f raw -o size=10M /var/lib/libvirt/images/test.raw
          sudo virsh define $TESTDATA/test-domain.xml
          sudo virsh start test
          sudo virsh pool-create $TESTDATA/test-pool.xml
          sudo virsh secret-define $TESTDATA/test-secret.xml

      - name: Lint and Vet
        run: |
          golint -set_exit_status ./...
          go vet ./...

      - name: Unit test
        run: go test -race ./...

      - name: integration test
        run: sudo go test -race -tags=integration ./...

      - name: Build
        run: go build ./...