Merge pull request #540 from mithro/kokoro

Support for CI using Google Compute Engine
This commit is contained in:
Tim Ansell 2019-02-07 22:09:06 +11:00 committed by GitHub
commit 52fbb75665
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 855 additions and 26 deletions

42
.github/kokoro/continuous-db-artix7.cfg vendored Normal file
View File

@ -0,0 +1,42 @@
# Format: //devtools/kokoro/config/proto/build.proto
build_file: "symbiflow-prjxray-continuous-db-artix7/.github/kokoro/db-full.sh"
timeout_mins: 4320
action {
define_artifacts {
# File types
regex: "**/diff.html"
regex: "**/diff.json"
regex: "**/*result*.xml"
regex: "**/*sponge_log.xml"
# Whole directories
# regex: "**/build/**" - Currently kokoro dies on number of artifacts.
regex: "**/build/*.log"
regex: "**/logs/**"
# The database
regex: "**/database/artix7/**"
strip_prefix: "github/symbiflow-prjxray-continuous-db-artix7/"
}
}
env_vars {
key: "KOKORO_TYPE"
value: "continuous"
}
env_vars {
key: "KOKORO_DIR"
value: "symbiflow-prjxray-continuous-db-artix7"
}
env_vars {
key: "XRAY_SETTINGS"
value: "artix7"
}
env_vars {
key: "XRAY_BUILD_TYPE"
value: "full"
}

View File

@ -0,0 +1,42 @@
# Format: //devtools/kokoro/config/proto/build.proto
build_file: "symbiflow-prjxray-continuous-db-kintex7/.github/kokoro/db-full.sh"
timeout_mins: 4320
action {
define_artifacts {
# File types
regex: "**/diff.html"
regex: "**/diff.json"
regex: "**/*result*.xml"
regex: "**/*sponge_log.xml"
# Whole directories
# regex: "**/build/**" - Currently kokoro dies on number of artifacts.
regex: "**/build/*.log"
regex: "**/logs/**"
# The database
regex: "**/database/kintex7/**"
strip_prefix: "github/symbiflow-prjxray-continuous-db-kintex7/"
}
}
env_vars {
key: "KOKORO_TYPE"
value: "continuous"
}
env_vars {
key: "KOKORO_DIR"
value: "symbiflow-prjxray-continuous-db-kintex7"
}
env_vars {
key: "XRAY_SETTINGS"
value: "kintex7"
}
env_vars {
key: "XRAY_BUILD_TYPE"
value: "full"
}

42
.github/kokoro/continuous-db-zynq7.cfg vendored Normal file
View File

@ -0,0 +1,42 @@
# Format: //devtools/kokoro/config/proto/build.proto
build_file: "symbiflow-prjxray-continuous-db-zynq7/.github/kokoro/db-full.sh"
timeout_mins: 4320
action {
define_artifacts {
# File types
regex: "**/diff.html"
regex: "**/diff.json"
regex: "**/*result*.xml"
regex: "**/*sponge_log.xml"
# Whole directories
# regex: "**/build/**" - Currently kokoro dies on number of artifacts.
regex: "**/build/*.log"
regex: "**/logs/**"
# The database
regex: "**/database/zynq7/**"
strip_prefix: "github/symbiflow-prjxray-continuous-db-zynq7/"
}
}
env_vars {
key: "KOKORO_TYPE"
value: "continuous"
}
env_vars {
key: "KOKORO_DIR"
value: "symbiflow-prjxray-continuous-db-zynq7"
}
env_vars {
key: "XRAY_SETTINGS"
value: "zynq7"
}
env_vars {
key: "XRAY_BUILD_TYPE"
value: "full"
}

120
.github/kokoro/ctest2junit.xsl vendored Normal file
View File

@ -0,0 +1,120 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/Site">
<xsl:variable name="Name"><xsl:value-of select="@Name"/></xsl:variable>
<xsl:variable name="Hostname"><xsl:value-of select="@Hostname"/></xsl:variable>
<xsl:variable name="TestCount"><xsl:value-of select="count(//TestList/Test)"/> </xsl:variable>
<xsl:variable name="ErrorCount"><xsl:value-of select="count(//TestList/Test[@Status='error'])"/> </xsl:variable>
<xsl:variable name="FailureCount"><xsl:value-of select="count(//Testing/Test[@Status='failed'])"/> </xsl:variable>
<testsuite name="{$Name}" hostname="{$Hostname}" errors="0" failures="{$FailureCount}" tests="{$TestCount}">
<xsl:variable name="BuildName"><xsl:value-of select="@BuildName"/></xsl:variable>
<xsl:variable name="BuildStamp"><xsl:value-of select="@BuildStamp"/></xsl:variable>
<xsl:variable name="Generator"><xsl:value-of select="@Generator"/></xsl:variable>
<xsl:variable name="CompilerName"><xsl:value-of select="@CompilerName"/></xsl:variable>
<xsl:variable name="OSName"><xsl:value-of select="@OSName"/></xsl:variable>
<xsl:variable name="OSRelease"><xsl:value-of select="@OSRelease"/></xsl:variable>
<xsl:variable name="OSVersion"><xsl:value-of select="@OSVersion"/></xsl:variable>
<xsl:variable name="OSPlatform"><xsl:value-of select="@OSPlatform"/></xsl:variable>
<xsl:variable name="Is64Bits"><xsl:value-of select="@Is64Bits"/></xsl:variable>
<xsl:variable name="VendorString"><xsl:value-of select="@VendorString"/></xsl:variable>
<xsl:variable name="VendorID"><xsl:value-of select="@VendorID"/></xsl:variable>
<xsl:variable name="FamilyID"><xsl:value-of select="@FamilyID"/></xsl:variable>
<xsl:variable name="ModelID"><xsl:value-of select="@ModelID"/></xsl:variable>
<xsl:variable name="ProcessorCacheSize"><xsl:value-of select="@ProcessorCacheSize"/></xsl:variable>
<xsl:variable name="NumberOfLogicalCPU"><xsl:value-of select="@NumberOfLogicalCPU"/></xsl:variable>
<xsl:variable name="NumberOfPhysicalCPU"><xsl:value-of select="@NumberOfPhysicalCPU"/></xsl:variable>
<xsl:variable name="TotalVirtualMemory"><xsl:value-of select="@TotalVirtualMemory"/></xsl:variable>
<xsl:variable name="TotalPhysicalMemory"><xsl:value-of select="@TotalPhysicalMemory"/></xsl:variable>
<xsl:variable name="LogicalProcessorsPerPhysical"><xsl:value-of select="@LogicalProcessorsPerPhysical"/></xsl:variable>
<xsl:variable name="ProcessorClockFrequency"><xsl:value-of select="@ProcessorClockFrequency"/></xsl:variable>
<properties>
<property name="BuildName" value="{$BuildName}" />
<property name="BuildStamp" value="{$BuildStamp}" />
<property name="Name" value="{$Name}" />
<property name="Generator" value="{$Generator}" />
<property name="CompilerName" value="{$CompilerName}" />
<property name="OSName" value="{$OSName}" />
<property name="Hostname" value="{$Hostname}" />
<property name="OSRelease" value="{$OSRelease}" />
<property name="OSVersion" value="{$OSVersion}" />
<property name="OSPlatform" value="{$OSPlatform}" />
<property name="Is64Bits" value="{$Is64Bits}" />
<property name="VendorString" value="{$VendorString}" />
<property name="VendorID" value="{$VendorID}" />
<property name="FamilyID" value="{$FamilyID}" />
<property name="ModelID" value="{$ModelID}" />
<property name="ProcessorCacheSize" value="{$ProcessorCacheSize}" />
<property name="NumberOfLogicalCPU" value="{$NumberOfLogicalCPU}" />
<property name="NumberOfPhysicalCPU" value="{$NumberOfPhysicalCPU}" />
<property name="TotalVirtualMemory" value="{$TotalVirtualMemory}" />
<property name="TotalPhysicalMemory" value="{$TotalPhysicalMemory}" />
<property name="LogicalProcessorsPerPhysical" value="{$LogicalProcessorsPerPhysical}" />
<property name="ProcessorClockFrequency" value="{$ProcessorClockFrequency}" />
</properties>
<xsl:apply-templates select="Testing/Test"/>
<system-out>
BuildName: <xsl:value-of select="$BuildName" />
BuildStamp: <xsl:value-of select="$BuildStamp" />
Name: <xsl:value-of select="$Name" />
Generator: <xsl:value-of select="$Generator" />
CompilerName: <xsl:value-of select="$CompilerName" />
OSName: <xsl:value-of select="$OSName" />
Hostname: <xsl:value-of select="$Hostname" />
OSRelease: <xsl:value-of select="$OSRelease" />
OSVersion: <xsl:value-of select="$OSVersion" />
OSPlatform: <xsl:value-of select="$OSPlatform" />
Is64Bits: <xsl:value-of select="$Is64Bits" />
VendorString: <xsl:value-of select="$VendorString" />
VendorID: <xsl:value-of select="$VendorID" />
FamilyID: <xsl:value-of select="$FamilyID" />
ModelID: <xsl:value-of select="$ModelID" />
ProcessorCacheSize: <xsl:value-of select="$ProcessorCacheSize" />
NumberOfLogicalCPU: <xsl:value-of select="$NumberOfLogicalCPU" />
NumberOfPhysicalCPU: <xsl:value-of select="$NumberOfPhysicalCPU" />
TotalVirtualMemory: <xsl:value-of select="$TotalVirtualMemory" />
TotalPhysicalMemory: <xsl:value-of select="$TotalPhysicalMemory" />
LogicalProcessorsPerPhysical: <xsl:value-of select="$LogicalProcessorsPerPhysical" />
ProcessorClockFrequency: <xsl:value-of select="$ProcessorClockFrequency" />
</system-out>
</testsuite>
</xsl:template>
<xsl:template match="Testing/Test">
<xsl:variable name="testcasename"><xsl:value-of select= "Name"/></xsl:variable>
<xsl:variable name="testclassname"><xsl:value-of select= " concat('this', substring(Path,2))"/></xsl:variable>
<xsl:variable name="exectime">
<xsl:for-each select="Results/NamedMeasurement">
<xsl:if test="@name = 'Execution Time'">
<xsl:value-of select="."/>
</xsl:if>
</xsl:for-each>
</xsl:variable>
<testcase name="{$testcasename}" classname="{$testclassname}" time="{$exectime}">
<xsl:if test="@Status = 'passed'">
</xsl:if>
<xsl:if test="@Status = 'failed'">
<xsl:variable name="failtype">
<xsl:for-each select="Results/NamedMeasurement">
<xsl:if test="@name = 'Exit Code'">
<xsl:value-of select="."/>
</xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:variable name="failcode">
<xsl:for-each select="Results/NamedMeasurement">
<xsl:if test="@name = 'Exit Value'">
<xsl:value-of select="."/>
</xsl:if>
</xsl:for-each>
</xsl:variable>
<failure message="{$failtype} ({$failcode})"><xsl:value-of select="Results/Measurement/Value/text()" /></failure>
</xsl:if>
<xsl:if test="@Status = 'notrun'">
<skipped><xsl:value-of select="Results/Measurement/Value/text()" /></skipped>
</xsl:if>
</testcase>
</xsl:template>
</xsl:stylesheet>

14
.github/kokoro/database.cfg vendored Normal file
View File

@ -0,0 +1,14 @@
build_file: "symbiflow-prjxray-db/.github/kokoro/database.sh"
timeout_mins: 10
action {
define_artifacts {
regex: "**/*result*.xml"
regex: "**/build/*.log"
regex: "**/build/**"
regex: "**/diff.*"
regex: "**/database/**"
strip_prefix: "github/symbiflow-prjxray-db/"
}
}

130
.github/kokoro/db-full.sh vendored Executable file
View File

@ -0,0 +1,130 @@
#!/bin/bash
set -e
cd github/$KOKORO_DIR/
source ./.github/kokoro/steps/hostsetup.sh
source ./.github/kokoro/steps/hostinfo.sh
source ./.github/kokoro/steps/git.sh
source ./.github/kokoro/steps/xilinx.sh
source ./.github/kokoro/steps/prjxray-env.sh
echo
echo "========================================"
echo "Downloading current database"
echo "----------------------------------------"
(
script --return --flush --command "./download-latest-db.sh" -
)
echo "----------------------------------------"
source settings/$XRAY_SETTINGS.sh
echo
echo "========================================"
echo "Cleaning out current database"
echo "----------------------------------------"
(
cd database
make clean-${XRAY_SETTINGS}-db
)
echo "----------------------------------------"
echo
echo "========================================"
echo "Running Database build"
echo "----------------------------------------"
(
cd fuzzers
# Output which fuzzers we are going to run
echo "make --dry-run"
make --dry-run
echo "----------------------------------------"
# Run the fuzzers
export MAX_VIVADO_PROCESS=$CORES
set -x
script --return --flush --command "make -j $CORES MAX_VIVADO_PROCESS=$CORES" -
set +x
echo "----------------------------------------"
# Check there is nothing to do after running...
echo
if [ $(make --dry-run | grep -v 'Nothing to be done' | wc -l) -gt 0 ]; then
echo "The following targets need to still run!"
make --dry-run
echo "----------------------------------------"
echo "Debug output on why they still need to run"
make --dry-run --debug
echo "----------------------------------------"
exit 1
else
echo "All good, nothing more to do!"
fi
)
echo "----------------------------------------"
# Check the database
#make checkdb-${XRAY_SETTINGS} || true
# Format the database
make formatdb-${XRAY_SETTINGS}
# Output if the database has differences
echo
echo "========================================"
echo " Database Differences"
echo "----------------------------------------"
(
cd database
echo "----------------------------------------"
echo " Database Status"
echo "----------------------------------------"
git status
git add *
echo "----------------------------------------"
echo
echo "----------------------------------------"
echo " Database Diff Summary"
echo "----------------------------------------"
git diff --stat --irreversible-delete --find-renames --find-copies --ignore-all-space
echo
echo "----------------------------------------"
echo " Database Diff"
echo "----------------------------------------"
git diff --color --irreversible-delete --find-renames --find-copies --ignore-all-space
echo
echo "----------------------------------------"
echo " Generating pretty diff"
echo "----------------------------------------"
diff2html --summary=open --file diff.html --format html \
-- \
--irreversible-delete --find-renames --find-copies --ignore-all-space \
|| true
diff2html --file diff.json --format json \
-- \
--irreversible-delete --find-renames --find-copies --ignore-all-space \
|| true
)
echo "----------------------------------------"
# Check the database and fail if it is broken.
#make checkdb-${XRAY_SETTINGS}
# If we get here, then all the fuzzers completed fine. Hence we are
# going to assume we don't want to keep all the build / logs / etc (as
# they are quite large). Thus do a clean to get rid of them.
echo
echo "========================================"
echo " Cleaning up after success"
echo "----------------------------------------"
(
cd fuzzers
echo
echo "Cleaning up so CI doesn't save all the excess data."
make clean
)
echo "----------------------------------------"

40
.github/kokoro/db-quick.sh vendored Executable file
View File

@ -0,0 +1,40 @@
#!/bin/bash
set -e
cd github/$KOKORO_DIR/
source ./.github/kokoro/steps/hostsetup.sh
source ./.github/kokoro/steps/hostinfo.sh
source ./.github/kokoro/steps/git.sh
source ./.github/kokoro/steps/xilinx.sh
source ./.github/kokoro/steps/prjxray-env.sh
echo
echo "========================================"
echo "Downloading current database"
echo "----------------------------------------"
(
./download-latest-db.sh
)
echo "----------------------------------------"
source settings/$XRAY_SETTINGS.sh
echo
echo "========================================"
echo "Running quick fuzzer sanity check"
echo "----------------------------------------"
(
cd fuzzers
echo "make --dry-run"
make --dry-run
echo "----------------------------------------"
export MAX_VIVADO_PROCESS=$CORES
set -x
script --return --flush --command "make -j $CORES MAX_VIVADO_PROCESS=$CORES QUICK=y" -
set +x
)
echo "----------------------------------------"

59
.github/kokoro/kokoro-cfg.py vendored Executable file
View File

@ -0,0 +1,59 @@
#!/usr/bin/env python3
db_full = """\
# Format: //devtools/kokoro/config/proto/build.proto
build_file: "symbiflow-prjxray-%(kokoro_type)s-db-%(part)s/.github/kokoro/db-full.sh"
timeout_mins: 4320
action {
define_artifacts {
# File types
regex: "**/diff.html"
regex: "**/diff.json"
regex: "**/*result*.xml"
regex: "**/*sponge_log.xml"
# Whole directories
# regex: "**/build/**" - Currently kokoro dies on number of artifacts.
regex: "**/build/*.log"
regex: "**/logs/**"
# The database
regex: "**/database/%(part)s/**"
strip_prefix: "github/symbiflow-prjxray-%(kokoro_type)s-db-%(part)s/"
}
}
env_vars {
key: "KOKORO_TYPE"
value: "%(kokoro_type)s"
}
env_vars {
key: "KOKORO_DIR"
value: "symbiflow-prjxray-%(kokoro_type)s-db-%(part)s"
}
env_vars {
key: "XRAY_SETTINGS"
value: "%(part)s"
}
env_vars {
key: "XRAY_BUILD_TYPE"
value: "full"
}
"""
for part in ['artix7', 'kintex7', 'zynq7']:
with open("continuous-db-%s.cfg" % part, "w") as f:
f.write(db_full % {
'part': part,
'kokoro_type': 'continuous',
})
with open("presubmit-db-%s.cfg" % part, "w") as f:
f.write(db_full % {
'part': part,
'kokoro_type': 'presubmit',
})

42
.github/kokoro/presubmit-db-artix7.cfg vendored Normal file
View File

@ -0,0 +1,42 @@
# Format: //devtools/kokoro/config/proto/build.proto
build_file: "symbiflow-prjxray-presubmit-db-artix7/.github/kokoro/db-full.sh"
timeout_mins: 4320
action {
define_artifacts {
# File types
regex: "**/diff.html"
regex: "**/diff.json"
regex: "**/*result*.xml"
regex: "**/*sponge_log.xml"
# Whole directories
# regex: "**/build/**" - Currently kokoro dies on number of artifacts.
regex: "**/build/*.log"
regex: "**/logs/**"
# The database
regex: "**/database/artix7/**"
strip_prefix: "github/symbiflow-prjxray-presubmit-db-artix7/"
}
}
env_vars {
key: "KOKORO_TYPE"
value: "presubmit"
}
env_vars {
key: "KOKORO_DIR"
value: "symbiflow-prjxray-presubmit-db-artix7"
}
env_vars {
key: "XRAY_SETTINGS"
value: "artix7"
}
env_vars {
key: "XRAY_BUILD_TYPE"
value: "full"
}

42
.github/kokoro/presubmit-db-kintex7.cfg vendored Normal file
View File

@ -0,0 +1,42 @@
# Format: //devtools/kokoro/config/proto/build.proto
build_file: "symbiflow-prjxray-presubmit-db-kintex7/.github/kokoro/db-full.sh"
timeout_mins: 4320
action {
define_artifacts {
# File types
regex: "**/diff.html"
regex: "**/diff.json"
regex: "**/*result*.xml"
regex: "**/*sponge_log.xml"
# Whole directories
# regex: "**/build/**" - Currently kokoro dies on number of artifacts.
regex: "**/build/*.log"
regex: "**/logs/**"
# The database
regex: "**/database/kintex7/**"
strip_prefix: "github/symbiflow-prjxray-presubmit-db-kintex7/"
}
}
env_vars {
key: "KOKORO_TYPE"
value: "presubmit"
}
env_vars {
key: "KOKORO_DIR"
value: "symbiflow-prjxray-presubmit-db-kintex7"
}
env_vars {
key: "XRAY_SETTINGS"
value: "kintex7"
}
env_vars {
key: "XRAY_BUILD_TYPE"
value: "full"
}

42
.github/kokoro/presubmit-db-zynq7.cfg vendored Normal file
View File

@ -0,0 +1,42 @@
# Format: //devtools/kokoro/config/proto/build.proto
build_file: "symbiflow-prjxray-presubmit-db-zynq7/.github/kokoro/db-full.sh"
timeout_mins: 4320
action {
define_artifacts {
# File types
regex: "**/diff.html"
regex: "**/diff.json"
regex: "**/*result*.xml"
regex: "**/*sponge_log.xml"
# Whole directories
# regex: "**/build/**" - Currently kokoro dies on number of artifacts.
regex: "**/build/*.log"
regex: "**/logs/**"
# The database
regex: "**/database/zynq7/**"
strip_prefix: "github/symbiflow-prjxray-presubmit-db-zynq7/"
}
}
env_vars {
key: "KOKORO_TYPE"
value: "presubmit"
}
env_vars {
key: "KOKORO_DIR"
value: "symbiflow-prjxray-presubmit-db-zynq7"
}
env_vars {
key: "XRAY_SETTINGS"
value: "zynq7"
}
env_vars {
key: "XRAY_BUILD_TYPE"
value: "full"
}

27
.github/kokoro/steps/git.sh vendored Executable file
View File

@ -0,0 +1,27 @@
#!/bin/bash
set -e
echo
echo "========================================"
echo "Git log"
echo "----------------------------------------"
echo "----------------------------------------"
echo
echo "========================================"
echo "Git fetching tags"
echo "----------------------------------------"
git fetch --tags || true
echo "----------------------------------------"
echo
echo "========================================"
echo "Git version info"
echo "----------------------------------------"
git log -n1
echo "----------------------------------------"
git describe --tags || true
echo "----------------------------------------"
git describe --tags --always || true
echo "----------------------------------------"

31
.github/kokoro/steps/hostinfo.sh vendored Executable file
View File

@ -0,0 +1,31 @@
#!/bin/bash
set -e
echo
echo "========================================"
echo "Host Environment"
echo "----------------------------------------"
export
echo "----------------------------------------"
echo
echo "========================================"
echo "Host CPU"
echo "----------------------------------------"
export CORES=$(nproc --all)
echo "Cores: $CORES"
echo
echo "Memory"
echo "----------------------------------------"
cat /proc/meminfo
echo "----------------------------------------"
echo
echo "========================================"
echo "Host files"
echo "----------------------------------------"
echo $PWD
echo "----------------------------------------"
find . | sort
echo "----------------------------------------"

63
.github/kokoro/steps/hostsetup.sh vendored Executable file
View File

@ -0,0 +1,63 @@
#!/bin/bash
set -e
echo
echo "========================================"
echo "Host updating packages"
echo "----------------------------------------"
sudo apt-get update
echo "----------------------------------------"
echo
echo "========================================"
echo "Host remove packages"
echo "----------------------------------------"
sudo apt-get remove -y \
python-pytest \
echo "----------------------------------------"
echo
echo "========================================"
echo "Host install packages"
echo "----------------------------------------"
sudo apt-get install -y \
bison \
build-essential \
ca-certificates \
clang-format \
cmake \
curl \
flex \
fontconfig \
git \
jq \
nodejs \
psmisc \
python \
python3 \
python3-dev \
python3-virtualenv \
python3-yaml \
virtualenv \
echo "----------------------------------------"
(
cd /tmp
# Upgrade pstree to support the -T flag.
wget https://storage.googleapis.com/prjxray-deps-debs/psmisc_23.2-1_amd64.deb
sudo dpkg --install psmisc_23.2-1_amd64.deb
which pstree
pstree --help || true
)
echo "----------------------------------------"
echo
echo "========================================"
echo "Getting diff2html to produce pretty database diffs"
echo "----------------------------------------"
(
sudo npm install -g diff2html-cli
)

16
.github/kokoro/steps/prjxray-env.sh vendored Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
set -e
echo
echo "========================================"
echo "Build the C++ tools"
echo "----------------------------------------"
make build --output-sync=target --warn-undefined-variables -j $CORES
echo "----------------------------------------"
echo
echo "========================================"
echo "Setup the Python environment"
echo "----------------------------------------"
make env --output-sync=target --warn-undefined-variables

8
.github/kokoro/steps/xilinx.sh vendored Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
# Fix up things related to Xilinx tool chain.
ls -l ~/.Xilinx
sudo chown -R $USER ~/.Xilinx
export XILINX_LOCAL_USER_DATA=no

19
.github/kokoro/tests.cfg vendored Normal file
View File

@ -0,0 +1,19 @@
build_file: "symbiflow-prjxray-tests/.github/kokoro/tests.sh"
timeout_mins: 10
action {
define_artifacts {
regex: "**/*.log"
regex: "**/*sponge_log.xml"
regex: "**/build/**/*.xml"
regex: "**/build/*.xml"
regex: "*result*.xml"
strip_prefix: "github/symbiflow-prjxray-tests/"
}
}
env_vars {
key: "KOKORO_DIR"
value: "symbiflow-prjxray-tests"
}

33
.github/kokoro/tests.sh vendored Executable file
View File

@ -0,0 +1,33 @@
#!/bin/bash
set -e
cd github/$KOKORO_DIR/
source ./.github/kokoro/steps/hostsetup.sh
source ./.github/kokoro/steps/hostinfo.sh
source ./.github/kokoro/steps/git.sh
source ./.github/kokoro/steps/prjxray-env.sh
echo
echo "========================================"
echo "Running tests"
echo "----------------------------------------"
(
make test --output-sync=target --warn-undefined-variables
)
echo "----------------------------------------"
echo
echo "========================================"
echo "Copying tests logs"
echo "----------------------------------------"
(
cat build/*test_results.xml
mkdir build/py
cp build/py_test_results.xml build/py/sponge_log.xml
mkdir build/cpp
cp build/cpp_test_results.xml build/cpp/sponge_log.xml
)
echo "----------------------------------------"

View File

@ -10,6 +10,7 @@ addons:
packages:
- clang-format-5.0
- g++-6
- xsltproc
install:
- export CC=gcc-6

View File

@ -3,7 +3,7 @@ ALL_EXCLUDE = third_party .git env build
# Tools + Environment
IN_ENV = if [ -e env/bin/activate ]; then . env/bin/activate; fi;
env:
virtualenv --python=python3 --system-site-packages env
virtualenv --python=python3 env
# Install prjxray
ln -sf $(PWD)/prjxray env/lib/python3.*/site-packages/
$(IN_ENV) python -c "import prjxray"
@ -34,13 +34,14 @@ test: test-py test-cpp
@true
test-py:
$(IN_ENV) PYTHONPATH="$(PWD):$(PWD)/third_party/fasm:$PYTHONPATH" py.test $(TEST_EXCLUDE) --doctest-modules --junitxml=build/py_test_results.xml
$(IN_ENV) which py.test; py.test $(TEST_EXCLUDE) --doctest-modules --junitxml=build/py_test_results.xml
test-cpp:
mkdir -p build
cd build && cmake -DPRJXRAY_BUILD_TESTING=ON ..
cd build && $(MAKE) -s
cd build && ctest --no-compress-output -T Test -C RelWithDebInfo --output-on-failure
xsltproc .github/kokoro/ctest2junit.xsl build/Testing/*/Test.xml > build/cpp_test_results.xml
.PHONY: test test-py test-cpp
@ -69,28 +70,49 @@ format: format-cpp format-docs format-py format-tcl
.PHONY: format format-cpp format-py format-tcl
# Project X-Ray database
# Targets related to Project X-Ray databases
# ------------------------
DATABASES=artix7 kintex7 zynq7
define database
# $(1) - Database name
checkdb-$(1):
@echo
@echo "Checking $(1) database"
@echo "============================"
@$(IN_ENV) python3 utils/checkdb.py --db-root database/$(1)
formatdb-$(1):
@echo
@echo "Formatting $(1) database"
@echo "============================"
@$(IN_ENV) cd database/$(1); python3 ../../utils/sort_db.py
@if [ -e database/Info.md ]; then $(IN_ENV) ./utils/info_md.py --keep; fi
.PHONY: checkdb-$(1) formatdb-$(1)
.NOTPARALLEL: checkdb-$(1) formatdb-$(1)
checkdb: checkdb-$(1)
formatdb: formatdb-$(1)
endef
$(foreach DB,$(DATABASES),$(eval $(call database,$(DB))))
checkdb:
@for DB in database/*; do if [ -d $$DB ]; then \
echo ; \
echo "Checking $$DB"; \
echo "============================"; \
$(IN_ENV) python3 utils/checkdb.py --db-root $$DB; \
fi; done
@true
formatdb:
@for DB in database/*; do if [ -d $$DB ]; then \
echo ; \
echo "Formatting $$DB"; \
echo "============================"; \
($(IN_ENV) cd $$DB; python3 ../../utils/sort_db.py || exit 1) || exit 1; \
fi; done
@make checkdb
$(IN_ENV) ./utils/info_md.py --keep
@true
.PHONY: checkdb formatdb
clean:
$(MAKE) -C database clean
$(MAKE) -C fuzzers clean
rm -rf build
.PHONY: clean

View File

@ -4,11 +4,5 @@ GITHUB_PROTO=${1:-https}
GITHUB_URL=$GITHUB_PROTO://github.com/SymbiFlow/prjxray-db.git
rm -rf database
git clone $GITHUB_URL database
# Causes confusion if you try to commit in DB dir
# But doesn't effect most people, probably leave as is
# rm -rf database/.git
# travis, .gitignore, etc
rm -f database/* 2>/dev/null
rm -f database/.* 2>/dev/null
# Restore settings files so fuzzers run correctly
# Update files in the database from our version so fuzzers run correctly.
git checkout HEAD database

View File

@ -87,7 +87,7 @@ $(eval $(call fuzzer,073-get_counts,))
$(eval $(call fuzzer,074-dump_all,005-tilegrid 072-ordered_wires))
endif
endif
$(eval $(call fuzzer,100-dsp-mskpat,005-tilegrid))
#$(eval $(call fuzzer,100-dsp-mskpat,005-tilegrid))
quick:
$(MAKE) QUICK=Y

View File

@ -70,7 +70,7 @@ Keep the existing commit information.
args = parser.parse_args()
info_md_filename = os.path.join('database', 'Info.md')
assert os.path.exists(info_md_filename)
assert os.path.exists(info_md_filename), info_md_filename
info_md = []