Skip to content

Persistent shared dirs #351

Persistent shared dirs

Persistent shared dirs #351

Workflow file for this run

name: Release
on: [push, workflow_dispatch, repository_dispatch]
permissions: write-all
jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
build: ${{ steps.build-needed.outputs.build }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
base: ${{ github.ref_name }}
filters: |
build:
- 'image/**'
- 'kernel/**'
- 'scripts/compile-kernel.sh'
- 'scripts/compile-image.sh'
- name: check if release exists
id: check-release
run: |
# gh release view returns non-zero if no such release exists
echo "build=$(gh release view ${{ github.ref_name }} &> /dev/null && echo $? || echo $?)" >> $GITHUB_OUTPUT
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: check if build is needed
id: build-needed
run: |
# Step outputs apparently are strings, so we have to compare against literals to avoid silly JS type coercion issues.
echo "build=${{ steps.filter.outputs.build == 'true' || steps.check-release.outputs.build != '0' }}" >> $GITHUB_OUTPUT
build-kernel:
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.build == 'true' && !github.event.act }}
strategy:
fail-fast: false
matrix:
arch: [riscv64, arm32]
include:
- arch: riscv64
board: hifive_unleashed
- arch: arm32
board: zynq_7000
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.buildroot-ccache
key: ${{ github.ref }}
- name: build kernel
run: scripts/compile-kernel.sh ${{ matrix.arch }} ${{ matrix.board }}
- name: upload artifacts
if: success()
uses: actions/upload-artifact@v3
with:
path: images/
build-image:
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.build == 'true' && !github.event.act }}
strategy:
fail-fast: false
matrix:
arch: [riscv64, arm32]
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.buildroot-ccache
key: ${{ github.ref }}
- name: build images
run: scripts/compile-image.sh ${{ matrix.arch }} ${{ matrix.name }}
- name: upload artifacts
if: success()
uses: actions/upload-artifact@v3
with:
path: images/
send-to-releases:
runs-on: ubuntu-latest
needs: [build-kernel, build-image]
if: ${{ needs.changes.outputs.build == 'true' && !failure() && !github.event.act }}
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
path: ./
- name: send to releases
uses: svenstaro/upload-release-action@v2
with:
repo_token: "${{ github.token }}"
tag: ${{ github.ref_name }}
file: artifact/*
file_glob: true
overwrite: true
riscv64-test:
runs-on: ubuntu-latest
needs: send-to-releases
if: ${{ !failure() && !github.event.act }}
steps:
- uses: actions/checkout@v3
- name: test
uses: ./
with:
shared-dirs: tests
renode-run: |
wget example.org
sh gpio.sh
sh i2c.sh
python pyrav4l2/.github/save_examples.py pyrav4l2/README.md
python examples/controls-enumeration.py
devices: |
vivid:
gpio:
left-bound: 0
right-bound: 16
i2c:
chip-addr: 0x1C
python-packages: |
git+https://github.com/antmicro/pyrav4l2.git@3c071a7494b6b67263c4dddb87b47025338fd960
git+https://github.com/antmicro/tuttest.git@c44309e0365c54759fb36864fb77bf8b347bd647
repos: https://github.com/antmicro/pyrav4l2.git pyrav4l2
riscv64-shared-dirs-test:
runs-on: ubuntu-latest
needs: send-to-releases
if: ${{ !failure() && !github.event.act }}
steps:
- uses: actions/checkout@v3
- name: prepare shared directiories
run: mkdir shared_dir shared_dir2
- name: test
uses: ./
with:
rootfs-size: +128M
shared-dirs: |
shared_dir /home/shared_dir
shared_dir2 /home/shared_dir2
renode-run: |
echo "shared-dirs-test" > shared_dir/f.txt
echo "shared-dirs-test2" > shared_dir2/f.txt
- name: read shared directories
run: |
$([ "$(cat shared_dir/f.txt)" = "shared-dirs-test" ])
$([ "$(cat shared_dir2/f.txt)" = "shared-dirs-test2" ])
ls shared_dir
cat shared_dir/f.txt
ls shared_dir2
cat shared_dir2/f.txt
arm32-shared-dirs-test:
runs-on: ubuntu-latest
needs: send-to-releases
if: ${{ !failure() && !github.event.act }}
steps:
- uses: actions/checkout@v3
- name: prepare shared directiories
run: mkdir shared_dir shared_dir2
- name: test
uses: ./
with:
arch: arm32
rootfs-size: +128M
shared-dirs: |
shared_dir /home/shared_dir
shared_dir2 /home/shared_dir2
renode-run: |
echo "shared-dirs-test" > shared_dir/f.txt
echo "shared-dirs-test2" > shared_dir2/f.txt
ls shared_dir
ls shared_dir2
- name: read shared directories
run: |
$([ "$(cat shared_dir/f.txt)" = "shared-dirs-test" ])
$([ "$(cat shared_dir2/f.txt)" = "shared-dirs-test" ])
ls shared_dir
cat shared_dir/f.txt
ls shared_dir2
cat shared_dir2/f.txt
arm32-test:
runs-on: ubuntu-latest
needs: send-to-releases
if: ${{ !failure() && !github.event.act }}
steps:
- uses: actions/checkout@v3
- name: test
uses: ./
with:
arch: arm32
shared-dirs: tests
renode-run: |
wget example.org
sh gpio.sh
sh i2c.sh
python pyrav4l2/.github/save_examples.py pyrav4l2/README.md
python examples/controls-enumeration.py
devices: |
vivid
gpio 0 16
i2c 0x1C
python-packages: |
git+https://github.com/antmicro/pyrav4l2.git@3c071a7494b6b67263c4dddb87b47025338fd960
git+https://github.com/antmicro/tuttest.git@c44309e0365c54759fb36864fb77bf8b347bd647
repos: https://github.com/antmicro/pyrav4l2.git pyrav4l2
riscv64-docker-test:
runs-on: ubuntu-latest
needs: send-to-releases
if: ${{ !failure() && !github.event.act }}
steps:
- uses: actions/checkout@v3
- name: test
uses: ./
with:
arch: riscv64
image-type: docker
image: riscv64/debian:experimental
shared-dirs: tests
renode-run: |
ls /dev | grep video
bash bash_test.sh
devices: vivid
arm32-docker-test:
runs-on: ubuntu-latest
needs: send-to-releases
if: ${{ !failure() && !github.event.act }}
steps:
- uses: actions/checkout@v3
- name: test
uses: ./
with:
arch: arm32
image-type: docker
image: arm32v7/ubuntu
shared-dirs: tests
renode-run: |
ls /dev | grep video
bash bash_test.sh
uname -a
cat /etc/os-release
devices: vivid
should-fail-test:
runs-on: ubuntu-latest
needs: send-to-releases
if: ${{ !failure() && !github.event.act }}
steps:
- uses: actions/checkout@v3
- name: test
uses: ./
with:
network: false
renode-run: |
should-fail: true
commands:
- "wget example.org"
custom-task-test:
runs-on: ubuntu-latest
needs: send-to-releases
if: ${{ !failure() && !github.event.act }}
steps:
- uses: actions/checkout@v3
- name: test
uses: ./
with:
shared-dirs: tests
tasks: |
tests/python_exists_image.yml
tests/python_exists_initramfs.yml