Skip to content

Commit

Permalink
Merge branch '51947-update_github_ci' into 'main'
Browse files Browse the repository at this point in the history
[#51947] update github ci

See merge request repositories/protoplaster-protoplaster!22
  • Loading branch information
kbieganski committed Dec 5, 2023
2 parents 7ffe673 + 24a5c23 commit 3789f12
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 18 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: 3.11
- name: Install protoplaster with pip
run: |
pip install .
Expand All @@ -35,13 +35,15 @@ jobs:
python3-pip telnet iptables iproute2 bc cpio rsync
- name: Run scripts in Renode
uses: antmicro/renode-linux-runner-action@v0
uses: antmicro/renode-linux-runner-action@v1
with:
shared-dir: ./
shared-dirs: ./
renode-run: |
./protoplaster/protoplaster -t tests/basic.yml
python -m venv .venv
source .venv/bin/activate
pip install .
protoplaster -t tests/basic.yml
devices: |
vivid
gpio 0 32
i2c 0x1C
python-packages: git+https://github.com/antmicro/protoplaster.git
10 changes: 9 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

- uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: 3.11
- name: Install protoplaster with pip
run: |
pip install .
Expand All @@ -38,12 +38,20 @@ jobs:
protoplaster -t example.yml --csv report.csv
protoplaster-test-report report.csv -t md
- name: Generate system report from yml
run: |
tuttest README.md system-report-example > system-report-example.yml
protoplaster-system-report -c system-report-example.yml --sudo
- name: Prepare docs template
run: |
cp -r .github/docs-template docs/
cp README.md docs/source/readme.md
cp protoplaster.md docs/source/
cp report.md docs/source/
echo -e "\`\`\`\n$(cat system-report-example.yml)\n\`\`\`" >> docs/source/system-report-example.yml
mkdir -p docs/source/_static/system_report
unzip report.zip -d docs/source/_static/system_report
- name: Build html
uses: docker://btdi/sphinx:min
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,15 @@ dmesg:
superuser: required
ip:
run: ip a
summary:
- title: Network interfaces state
run: python3 $PROTOPLASTER_SCRIPTS/generate_ip_table.py "$(cat)"
output: ip.out
on-fail:
run: ifconfig -a
summary:
- title: Network interfaces state
run: python3 $PROTOPLASTER_SCRIPTS/generate_ifconfig_table.py "$(cat)"
output: ifconfig.out
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,18 +124,23 @@ def run_command(config):
out = get_cmd_output(f"sh -c '{config.script}'")
summaries = []
for summary_config in config.summary_configs:
summary_content = subprocess.check_output(
f"sh -c '{summary_config.script}'",
shell=True,
text=True,
stderr=subprocess.STDOUT,
env=os.environ | {
"PROTOPLASTER_SCRIPTS":
f"{os.path.dirname(__file__)}/scripts"
},
input=out)
summaries.append(
SubReportSummary(summary_config.title, summary_content))
try:
summary_content = subprocess.check_output(
f"sh -c '{summary_config.script}'",
shell=True,
text=True,
stderr=subprocess.STDOUT,
env=os.environ | {
"PROTOPLASTER_SCRIPTS":
f"{os.path.dirname(__file__)}/scripts"
},
input=out)
summaries.append(
SubReportSummary(summary_config.title, summary_content))
except:
summaries.append(
SubReportSummary(summary_config.title,
"this summary is empty"))
return SubReportResult(config.name, out, config.output_file, summaries)
except:
if config.on_fail:
Expand Down

0 comments on commit 3789f12

Please sign in to comment.