Support Mac build, update GHA build to take into account latest Surelog compatibility changes, remove conda #1557
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2020-2022 F4PGA Authors | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
# | |
# SPDX-License-Identifier: Apache-2.0 | |
name: CI tests | |
on: [push, pull_request] | |
jobs: | |
Run-tests: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04, macos-11] | |
plugin: | |
- fasm | |
- xdc | |
- params | |
- sdc | |
- ql-iob | |
- design_introspection | |
- integrateinv | |
- ql-qlf | |
- dsp-ff | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Install Ubuntu Dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install git g++-9 build-essential bison flex \ | |
libreadline-dev gawk tcl-dev libffi-dev git graphviz xdot \ | |
pkg-config libboost-system-dev libboost-python-dev \ | |
libboost-filesystem-dev zlib1g-dev clang-format-8 cmake \ | |
nlohmann-json3-dev iverilog | |
if: ${{ runner.os != 'macOS'}} | |
- name: Setup homebrew cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/Library/Caches/Homebrew/boost--* | |
~/Library/Caches/Homebrew/downloads/*--boost-* | |
key: brew-${{ matrix.os }} | |
restore-keys: brew- | |
if: ${{ runner.os == 'macOS' }} | |
- name: Install Mac Dependencies | |
run: | | |
brew install bison boost ccache cmake flex graphviz icarus-verilog make nlohmann-json | |
sudo ln -s /usr/local/bin/gmake /usr/local/bin/make | |
env: | |
HOMEBREW_NO_AUTO_UPDATE: "1" | |
if: ${{ runner.os == 'macOS'}} | |
- name: Format | |
run: source .github/workflows/format-check.sh | |
env: | |
OS: ${{ runner.os }} | |
if: ${{ runner.os != 'macOS'}} | |
- name: ccache | |
uses: hendrikmuhs/ccache-action@v1 | |
with: | |
key: ccache-${{ matrix.os }}-${{ matrix.plugin }} | |
- name: Install yosys | |
run: | | |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | |
set -ex | |
git clone https://github.com/YosysHQ/yosys.git --branch yosys-0.17 | |
pushd yosys | |
make CONFIG=gcc -j`nproc` && sudo make CONFIG=gcc install | |
if: ${{ runner.os != 'macOS' }} | |
- name: Install yosys | |
run: | | |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | |
set -ex | |
git clone https://github.com/YosysHQ/yosys.git --branch yosys-0.17 | |
pushd yosys | |
make -j`nproc` && sudo make install | |
if: ${{ runner.os == 'macOS' }} | |
- name: Install Googletest | |
run: | | |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | |
set -ex | |
git clone --branch release-1.8.1 https://github.com/google/googletest.git | |
pushd googletest | |
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 . && cmake --build build && sudo cmake --install build | |
popd | |
- name: Build and test plugins | |
run: | | |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH" | |
.github/workflows/build-and-test.sh | |
env: | |
OS: ${{ runner.os }} | |
PLUGIN_NAME: ${{ matrix.plugin }} | |
release-tagging: | |
name: Version Tagging | |
runs-on: ubuntu-20.04 | |
if: ${{github.event_name == 'push' && github.ref == 'refs/heads/main'}} | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Tag with Makefile version if not already. | |
run: | | |
git config --local user.name "Development Bot" | |
git config --local user.email "f4pga-dev@chipsalliance.org" | |
# We want to tag whenever the version in the Makefile changes. | |
# So extract the hash of when the current version was entered. | |
read TAG_HASH TAG_VERSION <<<$(git annotate -l Makefile | sed 's/\(^[0-9A-Fa-f]\+\).*PLUGIN_VERSION\s\+=\s\+\([0-9]\+\.[0-9]\+\).*/\1 \2/p;d') | |
echo "F4PGA Yosys Plugin Version v${TAG_VERSION} at hash ${TAG_HASH}" | |
# If this is the first time we see this tag: apply. | |
if [ -z "$(git tag -l "v${TAG_VERSION}")" ]; then | |
git tag -a "v${TAG_VERSION}" ${TAG_HASH} -m "Update to v${TAG_VERSION}" | |
git push origin "v${TAG_VERSION}" | |
else | |
echo "Tag already applied" | |
fi |