Skip to content

Commit ab40220

Browse files
committed
init commit
1 parent 83f23ac commit ab40220

78 files changed

Lines changed: 1626 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.
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
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: Test Examples
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+
example:
16+
description: "Single example to test, with parent folder (e.g. examples/cryptolibrary)"
17+
required: false
18+
default: ""
19+
20+
jobs:
21+
# ── Stage 1: detect which examples 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 examples
32+
id: set-matrix
33+
run: |
34+
# Manual trigger with explicit example override
35+
if [[ -n "${{ github.event.inputs.example }}" ]]; then
36+
echo "matrix=[\"${{ github.event.inputs.example }}\"]" >> "$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 "Changed: ${CHANGED}"
54+
55+
# ── Stage 2: test matrix (os × example) ─────────────────────────────────────
56+
test:
57+
needs: detect-changes
58+
if: ${{ needs.detect-changes.outputs.matrix != '[]' }}
59+
runs-on: ${{ matrix.os }}
60+
strategy:
61+
fail-fast: false
62+
matrix:
63+
os: [ubuntu-latest, windows-latest]
64+
example: ${{ fromJson(needs.detect-changes.outputs.matrix) }}
65+
66+
steps:
67+
- uses: actions/checkout@v4
68+
69+
- name: Read RCC space from .rcc file
70+
id: rcc-space
71+
shell: bash
72+
run: |
73+
SPACE=$(grep '^SPACE=' ${{ matrix.example }}/.rcc | cut -d= -f2 | tr -d '[:space:]')
74+
echo "space=${SPACE}" >> "$GITHUB_OUTPUT"
75+
76+
- name: Download RCC
77+
shell: bash
78+
run: |
79+
BASE="https://github.com/elabit/robotmk/releases/download/v4.0.0"
80+
if [[ "${{ runner.os }}" == "Windows" ]]; then
81+
curl -fsSL -o rcc.exe "${BASE}/rcc_windows64.exe"
82+
echo "RCC_BIN=./rcc.exe" >> "$GITHUB_ENV"
83+
else
84+
curl -fsSL -o rcc "${BASE}/rcc_linux64"
85+
chmod +x rcc
86+
echo "RCC_BIN=./rcc" >> "$GITHUB_ENV"
87+
fi
88+
${RCC_BIN:-./rcc} --version
89+
90+
- name: Build RCC holotree environment
91+
shell: bash
92+
run: |
93+
$RCC_BIN holotree vars \
94+
--space ${{ steps.rcc-space.outputs.space }} \
95+
--robot ${{ matrix.example }}/robot.yaml
96+
97+
- name: Run Robot Framework suite
98+
shell: bash
99+
run: |
100+
$RCC_BIN task script \
101+
--space ${{ steps.rcc-space.outputs.space }} \
102+
--robot ${{ matrix.example }}/robot.yaml \
103+
-- robot ${{ matrix.example }}
104+
105+
- name: Upload RF output artifacts
106+
if: always()
107+
uses: actions/upload-artifact@v4
108+
with:
109+
name: rf-output-${{ matrix.example }}-${{ matrix.os }}
110+
path: ${{ matrix.example }}/output/
111+
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: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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 (run once after cloning)"
13+
cmds:
14+
- task: install-copier
15+
- task: download-rcc
16+
17+
install-copier:
18+
desc: Install copier into .venv (required for generate tasks)
19+
cmds:
20+
- pip install copier
21+
status:
22+
- test -x {{.VENV_COPIER}}
23+
24+
download-rcc:
25+
desc: Download RCC binary into _dev/.rcc/ (not committed to git)
26+
platforms: [linux, darwin]
27+
cmds:
28+
- bash _dev/scripts/download-rcc.sh
29+
30+
download-rcc-windows:
31+
desc: Download RCC binary into _dev\.rcc\ (Windows)
32+
platforms: [windows]
33+
cmds:
34+
- powershell -ExecutionPolicy Bypass -File _dev\scripts\download-rcc.ps1
35+
36+
# ── Generate ───────────────────────────────────────────────────────────────
37+
38+
generate:
39+
desc: "Regenerate all (or one) example from its Copier template. Usage: task generate / task generate EXAMPLE=cryptolibrary"
40+
platforms: [linux, darwin]
41+
cmds:
42+
- _dev/scripts/generate-all.sh {{.EXAMPLE}}
43+
44+
generate-windows:
45+
desc: "Regenerate all (or one) example (Windows). Usage: task generate-windows / task generate-windows EXAMPLE=cryptolibrary"
46+
platforms: [windows]
47+
cmds:
48+
- powershell -ExecutionPolicy Bypass -File _dev\scripts\generate-all.ps1 {{if .EXAMPLE}}-Filter {{.EXAMPLE}}{{end}}
49+
50+
# ── Test ───────────────────────────────────────────────────────────────────
51+
52+
test:
53+
desc: "Run a Robot Framework example locally via RCC. Usage: task test EXAMPLE=cryptolibrary"
54+
platforms: [linux, darwin]
55+
vars:
56+
EXAMPLE: '{{.EXAMPLE | default "cryptolibrary"}}'
57+
RCC: _dev/.rcc/rcc
58+
SPACE:
59+
sh: grep '^SPACE=' examples/{{.EXAMPLE}}/.rcc | cut -d= -f2 | tr -d '[:space:]'
60+
cmds:
61+
- '{{.RCC}} holotree vars --space {{.SPACE}} --robot examples/{{.EXAMPLE}}/robot.yaml'
62+
- '{{.RCC}} task script --space {{.SPACE}} --robot examples/{{.EXAMPLE}}/robot.yaml -- robot examples/{{.EXAMPLE}}'
63+
64+
test-windows:
65+
desc: "Run a Robot Framework example locally via RCC (Windows). Usage: task test-windows EXAMPLE=cryptolibrary"
66+
platforms: [windows]
67+
vars:
68+
EXAMPLE: '{{.EXAMPLE | default "cryptolibrary"}}'
69+
SPACE:
70+
sh: grep '^SPACE=' examples/{{.EXAMPLE}}/.rcc | cut -d= -f2 | tr -d '[:space:]'
71+
cmds:
72+
- '_dev\.rcc\rcc.exe holotree vars --space {{.SPACE}} --robot examples\{{.EXAMPLE}}\robot.yaml'
73+
- '_dev\.rcc\rcc.exe task script --space {{.SPACE}} --robot examples\{{.EXAMPLE}}\robot.yaml -- robot examples\{{.EXAMPLE}}'
74+
75+
# ── Shell ──────────────────────────────────────────────────────────────────
76+
77+
shell:
78+
desc: "Open an interactive RCC shell inside an example's environment. Usage: task shell EXAMPLE=cryptolibrary"
79+
platforms: [linux, darwin]
80+
vars:
81+
EXAMPLE: '{{.EXAMPLE | default "cryptolibrary"}}'
82+
RCC: _dev/.rcc/rcc
83+
SPACE:
84+
sh: grep '^SPACE=' examples/{{.EXAMPLE}}/.rcc | cut -d= -f2 | tr -d '[:space:]'
85+
cmds:
86+
- '{{.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)