Skip to content

Create main.yml

Create main.yml #1

Workflow file for this run

variables:
GIT_SUBMODULE_STRATEGY: recursive
stages:
- build
bitstream:
stage: build
image: nscscc:2019.2
before_script:
- source /opt/Xilinx/Vivado/2019.2/settings64.sh
- export PATH=/opt/mips-mti-elf/2016.05-06/bin:${PATH}
script:
- make -C asm
- python3 ./.ci-scripts/run-linter.py thinpad_top.xpr 2>linter.log
- str="thinpad_top.srcs"
- diff=""
- echo ${CI_COMMIT_BEFORE_SHA}
- git config --global --add safe.directory $(pwd)
- >
if [ "${CI_COMMIT_BEFORE_SHA}" == "0000000000000000000000000000000000000000" ]
then vivado -mode tcl -source .ci-scripts/bits.tcl thinpad_top.xpr
else
diff=$(git diff --name-only ${CI_COMMIT_BEFORE_SHA} ${CI_COMMIT_SHA})
fi
- echo $diff
- >
if [[ $diff =~ $str ]]
then vivado -mode tcl -source .ci-scripts/bits.tcl thinpad_top.xpr
fi
- test -f thinpad_top.runs/impl_1/*.bit || vivado -mode tcl -source .ci-scripts/bits.tcl thinpad_top.xpr
- test -f thinpad_top.runs/impl_1/*.bit
cache:
key : bit
paths :
- thinpad_top.runs/impl_1/*.bit
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
when: always
paths:
- asm/*.bin
- thinpad_top.runs/impl_1/*.bit
- thinpad_top.runs/*/runme.log
- linter.log