-
Notifications
You must be signed in to change notification settings - Fork 46
112 lines (93 loc) · 3.23 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# 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: ubuntu-20.04
strategy:
fail-fast: false
matrix:
plugin:
- fasm
- xdc
- params
- sdc
- ql-iob
- design_introspection
- integrateinv
- ql-qlf
- systemverilog
- uhdm
- dsp-ff
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/setup-python@v2
- name: Install
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
- name: Format
run: source .github/workflows/format-check.sh
env:
OS: ${{ runner.os }}
- name: ccache
uses: hendrikmuhs/ccache-action@v1
- name: Install Yosys
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
source .github/workflows/setup.sh
env:
OS: ${{ runner.os }}
- name: Build and test plugins
run: |
export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
source env/conda/bin/activate yosys-plugins
source .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@v2
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