feat: add esp-idf installation and depends for gitea act runner

This commit is contained in:
Bastian de Byl
2026-01-04 15:15:09 -05:00
parent d9bf3e5c75
commit 8685676109
4 changed files with 97 additions and 0 deletions

View File

@@ -9,3 +9,7 @@ gitea_instance_url: https://git.debyl.io
act_runner_bin: /usr/local/bin/act_runner act_runner_bin: /usr/local/bin/act_runner
act_runner_config_dir: /etc/act_runner act_runner_config_dir: /etc/act_runner
act_runner_work_dir: /var/lib/act_runner act_runner_work_dir: /var/lib/act_runner
# ESP-IDF configuration
esp_idf_version: v5.4.1
esp_idf_path: /opt/esp-idf

View File

@@ -12,3 +12,9 @@
name: podman.socket name: podman.socket
state: restarted state: restarted
daemon_reload: true daemon_reload: true
- name: restore esp-idf selinux context
become: true
ansible.builtin.command:
cmd: restorecon -R {{ esp_idf_path }}
changed_when: true

View File

@@ -0,0 +1,85 @@
---
- name: install ESP-IDF build dependencies
become: true
ansible.builtin.dnf:
name:
- git
- wget
- flex
- bison
- gperf
- python3
- python3-pip
- cmake
- ninja-build
- ccache
- libffi-devel
- libusb1-devel
state: present
tags: gitea-actions
- name: check if ESP-IDF is installed
ansible.builtin.stat:
path: "{{ esp_idf_path }}"
register: esp_idf_dir
tags: gitea-actions
- name: clone ESP-IDF repository
become: true
ansible.builtin.git:
repo: https://github.com/espressif/esp-idf.git
dest: "{{ esp_idf_path }}"
version: "{{ esp_idf_version }}"
recursive: true
force: false
when: not esp_idf_dir.stat.exists
tags: gitea-actions
- name: ensure ESP-IDF submodules are initialized
become: true
ansible.builtin.command:
cmd: git submodule update --init --recursive
chdir: "{{ esp_idf_path }}"
changed_when: false
tags: gitea-actions
- name: set ESP-IDF directory ownership
become: true
ansible.builtin.file:
path: "{{ esp_idf_path }}"
owner: "{{ gitea_runner_user }}"
group: "{{ gitea_runner_user }}"
recurse: true
tags: gitea-actions
- name: set SELinux context for ESP-IDF directory
become: true
community.general.sefcontext:
target: "{{ esp_idf_path }}(/.*)?"
setype: usr_t
state: present
when: ansible_selinux.status == "enabled"
notify: restore esp-idf selinux context
tags: gitea-actions
- name: create ESP-IDF tools directory for runner user
become: true
ansible.builtin.file:
path: "{{ gitea_runner_home }}/.espressif"
state: directory
owner: "{{ gitea_runner_user }}"
group: "{{ gitea_runner_user }}"
mode: "0755"
tags: gitea-actions
- name: install ESP-IDF tools for runner user
become: true
become_user: "{{ gitea_runner_user }}"
ansible.builtin.shell: |
export IDF_TOOLS_PATH="{{ gitea_runner_home }}/.espressif"
{{ esp_idf_path }}/install.sh esp32
args:
creates: "{{ gitea_runner_home }}/.espressif/tools"
environment:
HOME: "{{ gitea_runner_home }}"
tags: gitea-actions

View File

@@ -3,6 +3,8 @@
tags: gitea-actions tags: gitea-actions
- import_tasks: deps.yml - import_tasks: deps.yml
tags: gitea-actions tags: gitea-actions
- import_tasks: esp-idf.yml
tags: gitea-actions
- import_tasks: runner.yml - import_tasks: runner.yml
tags: gitea-actions tags: gitea-actions
- import_tasks: systemd.yml - import_tasks: systemd.yml