-
Notifications
You must be signed in to change notification settings - Fork 2
146 lines (125 loc) · 3.45 KB
/
build.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
name: Build project
on:
push:
branches: [ ng ]
tags:
- 'v*'
pull_request:
branches: [ ng ]
jobs:
build:
strategy:
matrix:
os:
- ubuntu-24.04
version:
- 2024.07
runs-on: ${{ matrix.os }}
permissions:
actions: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Setup dependencies
uses: daaku/gh-action-apt-install@v4
with:
packages: yosys
- name: Cache bsc
id: cache-bsc
uses: actions/cache@v4
with:
path: bsc
key: bsc-${{ matrix.version }}-${{ matrix.os }}-${{ hashFiles('.github/workflows/build.yml') }}
- name: Cleanup
if: steps.cache-bsc.outputs.cache-hit != 'true'
env:
GH_TOKEN: ${{ github.token }}
run: |
set +e
gh extension install actions/gh-actions-cache
REPO=${{ github.repository }}
echo "Fetching list of cache key"
cacheKeys=$(gh actions-cache list -R $REPO | cut -f 1 | grep ^bsc-)
echo "Deleting caches..."
for cacheKey in $cacheKeys
do
gh actions-cache delete $cacheKey -R $REPO --confirm
done
echo "Done"
- name: Download bsc
if: steps.cache-bsc.outputs.cache-hit != 'true'
run: |
wget -qO- https://github.com/B-Lang-org/bsc/releases/download/${{ matrix.version }}/bsc-${{ matrix.version }}-${{ matrix.os }}.tar.gz | tar xzf -
mv bsc-${{ matrix.version }}-${{ matrix.os }} bsc
echo "${{ github.workspace }}/bsc/bin" >> "$GITHUB_PATH"
- name: Install bsc-contrib
if: steps.cache-bsc.outputs.cache-hit != 'true'
run: |
git clone https://github.com/B-Lang-org/bsc-contrib.git
cd bsc-contrib
make -j$(nproc) PREFIX="$PWD/../bsc"
cd ..
- name: Download iEDA
if: steps.cache-bsc.outputs.cache-hit != 'true'
run: |
wget https://github.com/oscc-ip/artifact/releases/download/764f3f4/iEDA -O bsc/bin/iEDA
chmod +x bsc/bin/iEDA
- name: Setup Path
if: steps.cache-bsc.outputs.cache-hit == 'true'
run: |
echo "${{ github.workspace }}/bsc/bin" >> "$GITHUB_PATH"
- name: Build Project
run: |
make build
- name: Generate Report
run: |
make sta
- name: Combine Files
run: |
mv src/wrapper/* build/generated
cat build/generated/* > top.v
- name: Upload Combined File
uses: actions/upload-artifact@v4
with:
name: top
path: top.v
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: generated
path: build/generated
- name: Upload Report
uses: actions/upload-artifact@v4
with:
name: report
path: build/report
relase:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
id-token: write
attestations: write
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: top
merge-multiple: true
- name: Publish release
id: publish
uses: softprops/action-gh-release@v1
with:
fail_on_unmatched_files: true
files: |
*.v
- name: Attest Release Files
id: attest
uses: actions/attest-build-provenance@v1
with:
subject-path: |
*.v