@@ -14,116 +14,6 @@ concurrency:
1414 cancel-in-progress : true
1515
1616jobs :
17- code-tests :
18- name : Code
19- runs-on : ubuntu-24.04
20- strategy :
21- fail-fast : false
22- matrix :
23- go :
24- - oldstable
25- - stable
26- - tip
27- steps :
28- - name : Checkout
29- uses : actions/checkout@v5
30- with :
31- # Differential ShellCheck requires full git history
32- fetch-depth : 0
33-
34- - name : Dependency Review
35- uses : actions/dependency-review-action@v4
36- if : github.event_name == 'pull_request'
37-
38- - id : ShellCheck
39- name : Differential ShellCheck
40- uses : redhat-plumbers-in-action/differential-shellcheck@v5
41- env :
42- SHELLCHECK_OPTS : --shell sh
43- with :
44- token : ${{ secrets.GITHUB_TOKEN }}
45- if : github.event_name == 'pull_request' && matrix.go == 'stable'
46-
47- - name : Upload artifact with ShellCheck defects in SARIF format
48- uses : actions/upload-artifact@v4
49- with :
50- name : Differential ShellCheck SARIF
51- path : ${{ steps.ShellCheck.outputs.sarif }}
52- if : github.event_name == 'pull_request' && matrix.go == 'stable'
53-
54- - name : Install Go (${{ matrix.go }})
55- uses : actions/setup-go@v6
56- with :
57- go-version : ${{ matrix.go }}
58- if : matrix.go != 'tip'
59-
60- - name : Install Go (stable)
61- uses : actions/setup-go@v6
62- with :
63- go-version : stable
64- if : matrix.go == 'tip'
65-
66- - name : Install Go (tip)
67- run : |
68- go install golang.org/dl/gotip@latest
69- gotip download
70- ~/sdk/gotip/bin/go version
71- echo "PATH=$HOME/go/bin:$HOME/sdk/gotip/bin/:$PATH" >> $GITHUB_ENV
72- if : matrix.go == 'tip'
73-
74- - name : Install dependencies
75- run : |
76- sudo apt-get update
77- sudo apt-get install --no-install-recommends -y \
78- curl \
79- gettext \
80- git \
81- libacl1-dev \
82- libcap-dev \
83- libdbus-1-dev \
84- libcowsql-dev \
85- liblxc-dev \
86- lxc-templates \
87- libseccomp-dev \
88- libselinux-dev \
89- libsqlite3-dev \
90- libtool \
91- libudev-dev \
92- make \
93- pipx \
94- pkg-config \
95- shellcheck
96-
97- # With pipx >= 1.5.0, we could use pipx --global instead.
98- PIPX_HOME=/opt/pipx PIPX_BIN_DIR=/usr/local/bin \
99- pipx install codespell flake8
100-
101- - name : Fix repository permissions
102- run : |
103- sudo chown -R runner:docker .
104-
105- - name : Check compatible min Go version
106- run : |
107- go mod tidy
108-
109- - name : Download go dependencies
110- run : |
111- go mod download
112-
113- - name : Run Incus build
114- run : |
115- make
116-
117- - name : Run static analysis
118- env :
119- GITHUB_BEFORE : ${{ github.event.before }}
120- run : |
121- make static-analysis
122-
123- - name : Unit tests (all)
124- run : |
125- sudo --preserve-env=CGO_CFLAGS,CGO_LDFLAGS,CGO_LDFLAGS_ALLOW,LD_LIBRARY_PATH LD_LIBRARY_PATH=${LD_LIBRARY_PATH} env "PATH=${PATH}" go test ./...
126-
12717 system-tests :
12818 name : System
12919 strategy :
@@ -135,57 +25,9 @@ jobs:
13525 - cluster
13626 - standalone
13727 backend :
138- - dir
139- - btrfs
140- - lvm
141- - zfs
142- - ceph
143- - linstor
144- - random
28+ - nfs
14529 os :
14630 - ubuntu-24.04
147- include :
148- - go : oldstable
149- suite : cluster
150- backend : dir
151- os : ubuntu-24.04
152- - go : oldstable
153- suite : standalone
154- backend : dir
155- os : ubuntu-24.04
156- - go : tip
157- suite : cluster
158- backend : dir
159- os : ubuntu-24.04
160- - go : tip
161- suite : standalone
162- backend : dir
163- os : ubuntu-24.04
164-
165- - go : oldstable
166- suite : cluster
167- backend : dir
168- os : ubuntu-24.04-arm
169- - go : oldstable
170- suite : standalone
171- backend : dir
172- os : ubuntu-24.04-arm
173- - go : stable
174- suite : cluster
175- backend : dir
176- os : ubuntu-24.04-arm
177- - go : stable
178- suite : standalone
179- backend : dir
180- os : ubuntu-24.04-arm
181- - go : tip
182- suite : cluster
183- backend : dir
184- os : ubuntu-24.04-arm
185- - go : tip
186- suite : standalone
187- backend : dir
188- os : ubuntu-24.04-arm
18931 runs-on : ${{ matrix.os }}
19032
19133 steps :
@@ -434,6 +276,17 @@ jobs:
434276 # Update the runner env.
435277 echo "INCUS_LINSTOR_CLUSTER=${runner_ip}" >> "$GITHUB_ENV"
436278
279+ - name : Setup NFS
280+ if : ${{ matrix.backend == 'nfs' }}
281+ run : |
282+ set -x
283+ sudo apt-get install --no-install-recommends -y nfs-kernel-server
284+ sudo sed -i 's/# debug=0/debug=1/' /etc/nfs.conf
285+ echo "/media 10.0.0.0/8(rw,sync,no_subtree_check,no_root_squash,no_all_squash) 100.64.0.0/8(rw,sync,no_subtree_check,no_root_squash,no_all_squash)" | sudo tee /etc/exports
286+ sudo exportfs -a
287+ sudo systemctl restart nfs-server.service
288+ echo "INCUS_NFS_SHARE=$(hostname -I | cut -d' ' -f1):/media" >> "$GITHUB_ENV"
289+
437290 - name : " Ensure offline mode (block image server)"
438291 run : |
439292 sudo nft add table inet filter
@@ -457,148 +310,4 @@ jobs:
457310 chmod +x ~
458311 echo "root:1000000:1000000000" | sudo tee /etc/subuid /etc/subgid
459312 cd test
460- sudo --preserve-env=PATH,GOPATH,GITHUB_ACTIONS,INCUS_VERBOSE,INCUS_BACKEND,INCUS_CEPH_CLUSTER,INCUS_CEPH_CEPHFS,INCUS_CEPH_CEPHOBJECT_RADOSGW,INCUS_LINSTOR_LOCAL_SATELLITE,INCUS_LINSTOR_CLUSTER,INCUS_OFFLINE,INCUS_SKIP_TESTS,INCUS_REQUIRED_TESTS, INCUS_BACKEND=${{ matrix.backend }} ./main.sh ${{ matrix.suite }}
461-
462- client :
463- name : Client
464- strategy :
465- fail-fast : false
466- matrix :
467- go :
468- - oldstable
469- - stable
470- os :
471- - ubuntu-latest
472- - macos-latest
473- - windows-latest
474- runs-on : ${{ matrix.os }}
475-
476- steps :
477- - name : Checkout code
478- uses : actions/checkout@v5
479-
480- - name : Install Go
481- uses : actions/setup-go@v6
482- with :
483- go-version : ${{ matrix.go }}
484-
485- - name : Create build directory
486- run : |
487- mkdir bin
488-
489- - name : Build static incus (x86_64)
490- env :
491- CGO_ENABLED : 0
492- GOARCH : amd64
493- run : |
494- go build -o bin/incus.x86_64 ./cmd/incus
495-
496- - name : Build static incus (aarch64)
497- env :
498- CGO_ENABLED : 0
499- GOARCH : arm64
500- run : |
501- go build -o bin/incus.aarch64 ./cmd/incus
502-
503- - name : Build static incus-agent (x86_64)
504- if : runner.os == 'Linux' || runner.os == 'Windows'
505- env :
506- CGO_ENABLED : 0
507- GOARCH : amd64
508- run : |
509- go build -o bin/incus-agent.x86_64 ./cmd/incus-agent
510-
511- - name : Build static incus-agent (aarch64)
512- if : runner.os == 'Linux' || runner.os == 'Windows'
513- env :
514- CGO_ENABLED : 0
515- GOARCH : arm64
516- run : |
517- go build -o bin/incus-agent.aarch64 ./cmd/incus-agent
518-
519- - name : Build static incus-migrate
520- if : runner.os == 'Linux'
521- env :
522- CGO_ENABLED : 0
523- run : |
524- GOARCH=amd64 go build -o bin/incus-migrate.x86_64 ./cmd/incus-migrate
525- GOARCH=arm64 go build -o bin/incus-migrate.aarch64 ./cmd/incus-migrate
526-
527- - name : Build static lxd-to-incus
528- if : runner.os == 'Linux'
529- env :
530- CGO_ENABLED : 0
531- run : |
532- GOARCH=amd64 go build -o bin/lxd-to-incus.x86_64 ./cmd/lxd-to-incus
533- GOARCH=arm64 go build -o bin/lxd-to-incus.aarch64 ./cmd/lxd-to-incus
534-
535- - name : Unit tests (client)
536- env :
537- CGO_ENABLED : 0
538- run : go test -v ./client/...
539-
540- - name : Unit tests (incus)
541- env :
542- CGO_ENABLED : 0
543- run : go test -v ./cmd/incus/...
544-
545- - name : Unit tests (shared)
546- env :
547- CGO_ENABLED : 0
548- run : go test -v ./shared/...
549-
550- - name : Upload incus client artifacts
551- if : matrix.go == 'stable'
552- uses : actions/upload-artifact@v4
553- continue-on-error : true
554- with :
555- name : ${{ runner.os }}
556- path : bin/
557-
558- documentation :
559- name : Documentation
560- runs-on : ubuntu-24.04
561- steps :
562- - name : Checkout
563- uses : actions/checkout@v5
564-
565- - name : Install Go
566- uses : actions/setup-go@v6
567- with :
568- go-version : stable
569-
570- - name : Install dependencies
571- run : |
572- sudo apt-get install aspell aspell-en
573- sudo snap install mdl
574-
575- - name : Run markdown linter
576- run : |
577- make doc-lint
578-
579- - name : Run spell checker
580- run : |
581- make doc-spellcheck
582-
583- - name : Run inclusive naming checker
584- uses : get-woke/woke-action@v0
585- with :
586- fail-on-error : true
587- woke-args : " *.md **/*.md -c https://github.com/canonical/Inclusive-naming/raw/main/config.yml"
588-
589- - name : Run link checker
590- run : |
591- make doc-linkcheck
592-
593- - name : Build docs (Sphinx)
594- run : make doc
595-
596- - name : Print warnings (Sphinx)
597- run : if [ -s doc/.sphinx/warnings.txt ]; then cat doc/.sphinx/warnings.txt; exit 1; fi
598-
599- - name : Upload documentation artifacts
600- if : always()
601- uses : actions/upload-artifact@v4
602- with :
603- name : documentation
604- path : doc/html
313+ sudo --preserve-env=PATH,GOPATH,GITHUB_ACTIONS,INCUS_VERBOSE,INCUS_BACKEND,INCUS_CEPH_CLUSTER,INCUS_CEPH_CEPHFS,INCUS_CEPH_CEPHOBJECT_RADOSGW,INCUS_LINSTOR_LOCAL_SATELLITE,INCUS_LINSTOR_CLUSTER,INCUS_NFS_SHARE,INCUS_OFFLINE,INCUS_SKIP_TESTS,INCUS_REQUIRED_TESTS, INCUS_BACKEND=${{ matrix.backend }} ./main.sh ${{ matrix.suite }}
0 commit comments