Skip to content

Commit

Permalink
Merge pull request #4 from antmicro/add-gh-actions
Browse files Browse the repository at this point in the history
Add GH actions
  • Loading branch information
acomodi authored Dec 17, 2020
2 parents bb853d9 + cc5a5e5 commit 7063b08
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 3 deletions.
39 changes: 39 additions & 0 deletions .github/scripts/ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash

WORKDIR=${PWD}

# Getting the ARM toolchain
wget -qO- https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/RC2.1/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 | tar -xj
export PATH=${PWD}/gcc-arm-none-eabi-9-2019-q4-major/bin:$PATH

# Create artifacts directory
mkdir root boot

# Build U-boot bootloader
pushd u-boot-xlnx
export ARCH=arm
export CROSS_COMPILE=arm-none-eabi-
make zynq_zybo_z7_defconfig
make -j`nproc`

cp spl/boot.bin u-boot.img ${WORKDIR}/boot
popd

# Build Linux kernel
pushd linux-xlnx
git apply ../linux/0001-Add-symbiflow-tester-driver.patch
export ARCH=arm
export CROSS_COMPILE=arm-none-eabi-
export LOADADDR=0x8000
make xilinx_zynq_defconfig
make -j`nproc` uImage
make -j`nproc` dtbs
make -j`nproc` modules

cp arch/arm/boot/uImage ${WORKDIR}/boot
cp arch/arm/boot/dts/zynq-zybo-z7.dtb ${WORKDIR}/boot/devicetree.dtb
cp drivers/misc/symbiflow-tester.ko ${WORKDIR}/root
popd

# Adding required files to rootfs
cp -a python/symbiflow_test.py devmemX zynq_bootloader ${WORKDIR}/root
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI artifacts generation

on:
push:
tags:
- 'v*'


jobs:

Run-tests:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v2
with:
submodules: recursive

- name: Install Dependencies
run: |
sudo apt update
sudo apt install -y bzip2 make u-boot-tools
- name: Build Images
run: |
source .github/scripts/ci.sh
zip -r uboot-linux-images.zip root boot
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release xc7 automatic tester
draft: false
prerelease: false

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./uboot-linux-images.zip
asset_name: uboot-linux-images.zip
asset_content_type: application/zip
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ Building the kernel:

``` bash
cd linux-xlnx
git apply ../linux/0001-Add-symbiflow-tester-driver.patch
export ARCH=arm
export CROSS_COMPILE=arm-none-eabi-
export LOADADDR=0x8000
Expand All @@ -91,17 +92,18 @@ Copy the required files to the SD card:
``` bash
cp arch/arm/boot/uImage /path/to/mountpoint/boot
cp arch/arm/boot/dts/zynq-zybo-z7.dtb /path/to/mountpoint/boot/devicetree.dtb
sudo cp drivers/misci/symbiflow-tester.ko /path/to/mountpoint/rootfs/root
sudo cp drivers/misc/symbiflow-tester.ko /path/to/mountpoint/rootfs/root
```


### Adding required files to rootfs

Copy the required files to the SD card:

``` bash
sudo cp python/symbiflow_test.py /path/to/mountpoint/rootfs/root
sudo cp -a devmemX /path/to/mountpoint/rootfs/root
sudo cp -a zynq_bootloader /path/to/mountpoint/root
sudo cp -a zynq_bootloader /path/to/mountpoint/rootfs/root
```

## Running the tests
Expand All @@ -114,7 +116,7 @@ Stop U-Boot autoboot by pressing any key during countdown.
In U-Boot's console run the following commands:

```
setenv booargs "root=/dev/mmcblk0p2 rw rootwait"
setenv bootargs "root=/dev/mmcblk0p2 rw rootwait"
setenv bootcmd "load mmc 0 0x1000000 uImage && load mmc 0 0x2000000 devicetree.dtb && bootm 0x1000000 - 0x2000000"
saveenv
```
Expand Down

0 comments on commit 7063b08

Please sign in to comment.