Skip to content

Commit 4fe4f01

Browse files
committed
init commit
1 parent 83f23ac commit 4fe4f01

82 files changed

Lines changed: 1784 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.actrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-P ubuntu-latest=catthehacker/ubuntu:act-22.04

.githooks/pre-push

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
# pre-push hook: regenerates all examples and templates before pushing.
3+
# Aborts the push if generated files are not committed.
4+
#
5+
# Install: task setup (or: git config core.hooksPath .githooks)
6+
7+
set -euo pipefail
8+
9+
echo "→ Running task generate ..."
10+
task generate
11+
12+
if ! git diff --quiet; then
13+
echo ""
14+
echo "ERROR: task generate produced uncommitted changes." >&2
15+
echo "Please review, stage and commit the following files:" >&2
16+
git diff --name-only >&2
17+
echo ""
18+
echo "Then push again." >&2
19+
exit 1
20+
fi
21+
22+
echo "✓ All generated files are up to date."
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Release Please
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
release-please:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: googleapis/release-please-action@v4
16+
with:
17+
release-type: simple

.github/workflows/run-suites.yml

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
name: Run Suites
2+
3+
on:
4+
push:
5+
branches: ["main", "compat/**"]
6+
paths:
7+
- "examples/**"
8+
- "templates/**"
9+
pull_request:
10+
paths:
11+
- "examples/**"
12+
- "templates/**"
13+
workflow_dispatch:
14+
inputs:
15+
suite:
16+
description: "Single suite to test, with parent folder (e.g. examples/cryptolibrary)"
17+
required: false
18+
default: ""
19+
20+
jobs:
21+
# ── Stage 1: detect which suites changed ──────────────────────────────────
22+
detect-changes:
23+
runs-on: ubuntu-latest
24+
outputs:
25+
matrix: ${{ steps.set-matrix.outputs.matrix }}
26+
steps:
27+
- uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 2
30+
31+
- name: Detect changed suites
32+
id: set-matrix
33+
run: |
34+
# Manual trigger with explicit suite override
35+
if [[ -n "${{ github.event.inputs.suite }}" ]]; then
36+
echo "matrix=[\"${{ github.event.inputs.suite }}\"]" >> "$GITHUB_OUTPUT"
37+
exit 0
38+
fi
39+
40+
# Detect changed folders under examples/ and templates/
41+
CHANGED=$(git diff --name-only HEAD~1 HEAD \
42+
| grep -E '^(examples|templates)/' \
43+
| cut -d/ -f1-2 \
44+
| sort -u \
45+
| jq -R . | jq -sc .)
46+
47+
# Fall back to all examples + templates if nothing detected (e.g. first commit)
48+
if [[ "${CHANGED}" == "[]" || -z "${CHANGED}" ]]; then
49+
CHANGED=$(ls -d examples/*/ templates/*/ 2>/dev/null | sed 's|/$||' | jq -R . | jq -sc .)
50+
fi
51+
52+
echo "matrix=${CHANGED}" >> "$GITHUB_OUTPUT"
53+
echo "The following subfolder have changed and will be tested:"
54+
echo "${CHANGED}"
55+
56+
# ── Stage 2: test matrix (os × suite) ─────────────────────────────────────
57+
test:
58+
needs: detect-changes
59+
if: ${{ needs.detect-changes.outputs.matrix != '[]' }}
60+
runs-on: ${{ matrix.os }}
61+
strategy:
62+
fail-fast: false
63+
# We have 2 OS and want to run max 1 job per OS (make use of pre-build RCC environments!)
64+
max-parallel: 2
65+
matrix:
66+
suite: ${{ fromJson(needs.detect-changes.outputs.matrix) }}
67+
os: [ubuntu-latest, windows-latest]
68+
69+
steps:
70+
- uses: actions/checkout@v4
71+
72+
- name: Read RCC space from .rcc file
73+
id: rcc-space
74+
shell: bash
75+
run: |
76+
SPACE=$(grep '^SPACE=' ${{ matrix.suite }}/.rcc | cut -d= -f2 | tr -d '[:space:]')
77+
echo "space=${SPACE}" >> "$GITHUB_OUTPUT"
78+
# Sanitize matrix.suite (e.g. examples/cryptolibrary → examples-cryptolibrary)
79+
echo "safe_name=$(echo '${{ matrix.suite }}' | tr '/' '-')" >> "$GITHUB_OUTPUT"
80+
81+
- name: Download RCC
82+
shell: bash
83+
run: |
84+
BASE="https://github.com/elabit/robotmk/releases/download/v4.0.0"
85+
if [[ "${{ runner.os }}" == "Windows" ]]; then
86+
curl -fsSL -o rcc.exe "${BASE}/rcc_windows64.exe"
87+
echo "RCC_BIN=./rcc.exe" >> "$GITHUB_ENV"
88+
else
89+
curl -fsSL -o rcc "${BASE}/rcc_linux64"
90+
chmod +x rcc
91+
echo "RCC_BIN=./rcc" >> "$GITHUB_ENV"
92+
fi
93+
${RCC_BIN:-./rcc} --version
94+
95+
- name: Build RCC holotree environment
96+
shell: bash
97+
run: |
98+
$RCC_BIN holotree vars \
99+
--space ${{ steps.rcc-space.outputs.space }} \
100+
--robot ${{ matrix.suite }}/robot.yaml
101+
102+
- name: Load .env if present
103+
shell: bash
104+
run: |
105+
ENV_FILE="${{ matrix.suite }}/.env"
106+
if [[ -f "${ENV_FILE}" ]]; then
107+
echo "Loading variables from ${ENV_FILE}"
108+
grep -v '^\s*#' "${ENV_FILE}" | grep -v '^\s*$' >> "$GITHUB_ENV"
109+
fi
110+
111+
- name: Setup tmate session
112+
uses: mxschmitt/action-tmate@v3
113+
114+
- name: Run Robot Framework suite
115+
shell: bash
116+
run: |
117+
$RCC_BIN task script \
118+
--space ${{ steps.rcc-space.outputs.space }} \
119+
--robot ${{ matrix.suite }}/robot.yaml \
120+
-- robot .
121+
122+
- name: Upload RF output artifacts
123+
if: always()
124+
uses: actions/upload-artifact@v4
125+
with:
126+
name: rf-output-${{ steps.rcc-space.outputs.safe_name }}-${{ matrix.os }}
127+
path: ${{ matrix.suite }}/output/
128+
if-no-files-found: ignore

.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Python virtualenv (used for copier by maintainers)
2+
.venv/
3+
4+
# RCC binaries – download via _dev/scripts/download-rcc.sh, do not commit
5+
_dev/.rcc/rcc*
6+
7+
# Robot Framework output artifacts
8+
output/
9+
results/
10+
log.html
11+
report.html
12+
output.xml
13+
14+
# RCC holotree (local environment cache)
15+
.robocorp/
16+
17+
# macOS
18+
.DS_Store
19+
20+
# Editor
21+
.vscode/settings.json
22+
*.swp
23+
24+
# BMAD
25+
.agents/
26+
_bmad/
27+
_bmad-output/

Taskfile.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# https://taskfile.dev
2+
version: '3'
3+
4+
vars:
5+
VENV_COPIER: .venv/bin/copier
6+
7+
tasks:
8+
9+
# ── Setup ──────────────────────────────────────────────────────────────────
10+
11+
setup:
12+
desc: "Full onboarding: install copier + download RCC + install git hooks (run once after cloning)"
13+
cmds:
14+
- task: install-copier
15+
- task: download-rcc
16+
- task: install-hooks
17+
18+
install-hooks:
19+
desc: Register .githooks/ as the git hooks directory
20+
cmds:
21+
- git config core.hooksPath .githooks
22+
status:
23+
- test "$(git config core.hooksPath)" = ".githooks"
24+
25+
install-copier:
26+
desc: Install copier into .venv (required for generate tasks)
27+
cmds:
28+
- pip install copier
29+
status:
30+
- test -x {{.VENV_COPIER}}
31+
32+
download-rcc:
33+
desc: Download RCC binary into _dev/.rcc/ (not committed to git)
34+
platforms: [linux, darwin]
35+
cmds:
36+
- bash _dev/scripts/download-rcc.sh
37+
38+
download-rcc-windows:
39+
desc: Download RCC binary into _dev\.rcc\ (Windows)
40+
platforms: [windows]
41+
cmds:
42+
- powershell -ExecutionPolicy Bypass -File _dev\scripts\download-rcc.ps1
43+
44+
# ── Generate ───────────────────────────────────────────────────────────────
45+
46+
generate:
47+
desc: "Regenerate all (or one) example from its Copier template. Usage: task generate / task generate EXAMPLE=cryptolibrary"
48+
platforms: [linux, darwin]
49+
cmds:
50+
- _dev/scripts/generate-all.sh {{.EXAMPLE}}
51+
52+
generate-windows:
53+
desc: "Regenerate all (or one) example (Windows). Usage: task generate-windows / task generate-windows EXAMPLE=cryptolibrary"
54+
platforms: [windows]
55+
cmds:
56+
- powershell -ExecutionPolicy Bypass -File _dev\scripts\generate-all.ps1 {{if .EXAMPLE}}-Filter {{.EXAMPLE}}{{end}}
57+
58+
# ── Test ───────────────────────────────────────────────────────────────────
59+
60+
test:
61+
desc: "Run a Robot Framework example locally via RCC. Usage: task test EXAMPLE=cryptolibrary"
62+
platforms: [linux, darwin]
63+
vars:
64+
EXAMPLE: '{{.EXAMPLE | default "cryptolibrary"}}'
65+
RCC: _dev/.rcc/rcc
66+
SPACE:
67+
sh: grep '^SPACE=' examples/{{.EXAMPLE}}/.rcc | cut -d= -f2 | tr -d '[:space:]'
68+
cmds:
69+
- '{{.RCC}} holotree vars --space {{.SPACE}} --robot examples/{{.EXAMPLE}}/robot.yaml'
70+
- '{{.RCC}} task script --space {{.SPACE}} --robot examples/{{.EXAMPLE}}/robot.yaml -- robot .'
71+
72+
test-windows:
73+
desc: "Run a Robot Framework example locally via RCC (Windows). Usage: task test-windows EXAMPLE=cryptolibrary"
74+
platforms: [windows]
75+
vars:
76+
EXAMPLE: '{{.EXAMPLE | default "cryptolibrary"}}'
77+
SPACE:
78+
sh: grep '^SPACE=' examples/{{.EXAMPLE}}/.rcc | cut -d= -f2 | tr -d '[:space:]'
79+
cmds:
80+
- '_dev\.rcc\rcc.exe holotree vars --space {{.SPACE}} --robot examples\{{.EXAMPLE}}\robot.yaml'
81+
- '_dev\.rcc\rcc.exe task script --space {{.SPACE}} --robot examples\{{.EXAMPLE}}\robot.yaml -- robot .'
82+
83+
# ── Shell ──────────────────────────────────────────────────────────────────
84+
85+
shell:
86+
desc: "Open an interactive RCC shell inside an example's environment. Usage: task shell EXAMPLE=cryptolibrary"
87+
platforms: [linux, darwin]
88+
vars:
89+
EXAMPLE: '{{.EXAMPLE | default "cryptolibrary"}}'
90+
RCC: _dev/.rcc/rcc
91+
SPACE:
92+
sh: grep '^SPACE=' examples/{{.EXAMPLE}}/.rcc | cut -d= -f2 | tr -d '[:space:]'
93+
cmds:
94+
- '{{.RCC}} task shell --space {{.SPACE}} --robot examples/{{.EXAMPLE}}/robot.yaml'

_dev/.rcc/README.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
RCC binaries are downloaded by _dev/scripts/download-rcc.sh — not committed to git.

0 commit comments

Comments
 (0)