Skip to content
This repository was archived by the owner on Oct 1, 2025. It is now read-only.

Commit 75f1f9f

Browse files
committed
init: initial commit
0 parents  commit 75f1f9f

25 files changed

+2275
-0
lines changed

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
7+
- package-ecosystem: "cargo"
8+
directory: "/"
9+
schedule:
10+
interval: "monthly"

.github/workflows/push.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: Build/Test oxidizr
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
test:
15+
name: Build/Test oxidizr
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Check out code
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Setup Rust
24+
run: |
25+
sudo apt-get update
26+
sudo apt-get install -y build-essential
27+
sudo snap install --classic rustup
28+
rustup default stable
29+
30+
- name: Build oxidizr
31+
run: |
32+
cargo build
33+
34+
- name: Run tests
35+
run: |
36+
cargo test -- --show-output
37+
38+
define-matrix:
39+
name: Define spread matrix
40+
runs-on: ubuntu-24.04
41+
outputs:
42+
suites: ${{ steps.suites.outputs.suites }}
43+
steps:
44+
- name: Checkout
45+
uses: actions/checkout@v4
46+
47+
- name: Setup Go
48+
uses: actions/setup-go@v5
49+
50+
- name: Install
51+
run: |
52+
go install github.com/snapcore/spread/cmd/spread@latest
53+
54+
- name: Generate matrix list
55+
id: suites
56+
run: |
57+
list="$(spread -list lxd | jq -r -ncR '[inputs | select(length>0)]')"
58+
echo "suites=$list"
59+
echo "suites=$list" >> $GITHUB_OUTPUT
60+
61+
spread-tests:
62+
name: Spread (${{ matrix.suite }})
63+
runs-on: ubuntu-24.04
64+
needs:
65+
- test
66+
- define-matrix
67+
strategy:
68+
fail-fast: false
69+
matrix:
70+
test: ${{ fromJSON(needs.define-matrix.outputs.suites) }}
71+
steps:
72+
- name: Checkout
73+
uses: actions/checkout@v4
74+
75+
- name: Download binary artifact
76+
uses: actions/download-artifact@v4
77+
with:
78+
name: binary
79+
80+
- name: Setup Go
81+
uses: actions/setup-go@v5
82+
with:
83+
go-version-file: "go.mod"
84+
85+
- name: Install
86+
run: |
87+
go install github.com/snapcore/spread/cmd/spread@latest
88+
89+
- name: Run integration tests
90+
run: |
91+
spread -v "${{ matrix.test }}"
92+
93+
snap:
94+
name: Build snap
95+
strategy:
96+
matrix:
97+
include:
98+
- os: ubuntu-24.04
99+
- os: ubuntu-24.04-arm
100+
runs-on: ${{ matrix.os }}
101+
steps:
102+
- name: Check out the code
103+
uses: actions/checkout@v4
104+
with:
105+
fetch-depth: 0
106+
107+
- name: Setup LXD
108+
uses: canonical/[email protected]
109+
110+
- name: Setup Snapcraft
111+
run: sudo snap install --classic snapcraft
112+
113+
- name: Build snap
114+
run: snapcraft --verbose

.github/workflows/release.yml

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags: ["v*"]
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
test:
13+
name: Build/Test oxidizr
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Check out code
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Setup Rust
22+
run: |
23+
sudo apt-get update
24+
sudo apt-get install -y build-essential
25+
sudo snap install --classic rustup
26+
rustup default stable
27+
28+
- name: Build oxidizr
29+
run: |
30+
cargo build
31+
32+
- name: Run tests
33+
run: |
34+
cargo test -- --show-output
35+
36+
define-matrix:
37+
name: Define spread matrix
38+
runs-on: ubuntu-24.04
39+
outputs:
40+
suites: ${{ steps.suites.outputs.suites }}
41+
steps:
42+
- name: Checkout
43+
uses: actions/checkout@v4
44+
45+
- name: Setup Go
46+
uses: actions/setup-go@v5
47+
48+
- name: Install
49+
run: |
50+
go install github.com/snapcore/spread/cmd/spread@latest
51+
52+
- name: Generate matrix list
53+
id: suites
54+
run: |
55+
list="$(spread -list lxd | jq -r -ncR '[inputs | select(length>0)]')"
56+
echo "suites=$list"
57+
echo "suites=$list" >> $GITHUB_OUTPUT
58+
59+
spread-tests:
60+
name: Spread (${{ matrix.suite }})
61+
runs-on: ubuntu-24.04
62+
needs:
63+
- test
64+
- define-matrix
65+
strategy:
66+
fail-fast: false
67+
matrix:
68+
test: ${{ fromJSON(needs.define-matrix.outputs.suites) }}
69+
steps:
70+
- name: Checkout
71+
uses: actions/checkout@v4
72+
73+
- name: Download binary artifact
74+
uses: actions/download-artifact@v4
75+
with:
76+
name: binary
77+
78+
- name: Setup Go
79+
uses: actions/setup-go@v5
80+
with:
81+
go-version-file: "go.mod"
82+
83+
- name: Install
84+
run: |
85+
go install github.com/snapcore/spread/cmd/spread@latest
86+
87+
- name: Run integration tests
88+
run: |
89+
spread -v "${{ matrix.test }}"
90+
91+
snap:
92+
name: Release snap
93+
strategy:
94+
matrix:
95+
include:
96+
- os: ubuntu-24.04
97+
- os: ubuntu-24.04-arm
98+
runs-on: ${{ matrix.os }}
99+
steps:
100+
- name: Check out the code
101+
uses: actions/checkout@v4
102+
with:
103+
fetch-depth: 0
104+
105+
- name: Check versions match
106+
run: |
107+
version="$(grep -m1 -Po "version = \"\K[^\"]+" Cargo.toml)"
108+
if [[ "v${version}" != "${GITHUB_REF#refs/*/}" ]]; then
109+
echo "Cargo package version and tag do not match; refusing to continue."
110+
exit 1
111+
fi
112+
113+
- name: Setup LXD
114+
uses: canonical/[email protected]
115+
116+
- name: Setup Snapcraft
117+
run: sudo snap install --classic snapcraft
118+
119+
- name: Build snap
120+
run: snapcraft --verbose
121+
122+
- name: Release snap
123+
env:
124+
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_SECRET }}
125+
run: |
126+
snapcraft upload oxidizr_*.snap --release latest/candidate

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
result*
2+
/target
3+
*.snap
4+
snapcraft*.txt
5+
test-up.sh
6+
.spread-reuse*

0 commit comments

Comments
 (0)