Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: Build ISO

on:
pull_request:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v6

- name: Setup Go
uses: actions/setup-go@v6
with:
go-version: 1.25

- name: Install tools
run: |
go install kcl-lang.io/cli/cmd/kcl@latest
echo "$HOME/go/bin" >> $GITHUB_PATH

- uses: hashicorp/setup-terraform@v3
with:
terraform_version: "1.12.0"

- uses: terraform-linters/setup-tflint@v6
name: Setup TFLint
with:
tflint_version: v0.52.0
cache: true

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install Ansible
run: |
python3 -m pip install --upgrade pip
pip3 install ansible

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Build ISO
run: |
make build
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ HOSTS_DIR := $(ROOT_DIR)/hosts
LIVEOS_DIR := $(ROOT_DIR)/liveOS
SBIN_DIR := $(ROOT_DIR)/sbin

# Set vars for executables
TF_BIN := $(or $(shell command -v terraform 2>/dev/null),$(TOOLS_DIR)/terraform)
TFLINT_BIN := $(or $(shell command -v tflint 2>/dev/null),$(TOOLS_DIR)/tflint)
KCL_BIN := $(or $(shell command -v kcl 2>/dev/null),$(TOOLS_DIR)/kcl)
DOCKER_BIN := $(or $(shell command -v docker 2>/dev/null),$(TOOLS_DIR)/docker/bin/docker)
ANSIBLE_BIN := $(or $(shell command -v ansible-playbook 2>/dev/null),$(TOOLS_DIR)/ansible/bin/ansible-playbook)

# Export common vars for use in sub-targets
export ROOT_DIR
export SANDBOX_DIR
Expand All @@ -17,6 +24,12 @@ export CACHE_DIR
export TOOLS_DIR
export HOSTS_DIR

export TF_BIN
export TFLINT_BIN
export KCL_BIN
export DOCKER_BIN
export ANSIBLE_BIN

# Include Makefiles from relevant subdirectories
include configs/config.mk
include sandbox/dev.mk
Expand Down
2 changes: 0 additions & 2 deletions configs/config.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
.PHONY: cfg.generate cfg.clean

KCL_BIN := $(TOOLS_DIR)/kcl

cfg.clean:
@echo "Cleaning KCL output in ..."
rm -f $(HOSTS_DIR)/router/ansible/host_vars/router.yaml
Expand Down
2 changes: 1 addition & 1 deletion liveOS/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
terraform {
required_version = ">= 1.13.0"
required_version = ">= 1.12.0"
required_providers {
libvirt = {
source = "dmacvicar/libvirt"
Expand Down
5 changes: 0 additions & 5 deletions liveOS/os.mk
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
.PHONY: os.clean os.build

TF_PLAN := $(CACHE_DIR)/tfdata/liveos/plan
TF_BIN := $(TOOLS_DIR)/terraform
TFLINT_BIN := $(TOOLS_DIR)/tflint
DOCKER_BIN := $(TOOLS_DIR)/docker/docker

os.clean:
@echo "Destroying resources..."
$(TF_BIN) -chdir=$(LIVEOS_DIR) destroy -auto-approve
Expand Down
4 changes: 0 additions & 4 deletions sandbox/dev.mk
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
.PHONY: dev.clean dev.build

TF_BIN := $(TOOLS_DIR)/terraform
TFLINT_BIN := $(TOOLS_DIR)/tflint
ANSIBLE_BIN := $(TOOLS_DIR)/ansible/bin/ansible-playbook

dev.clean:
@echo "Destroying resources..."
$(TF_BIN) -chdir=$(SANDBOX_DIR) destroy -auto-approve
Expand Down
Loading