-
Notifications
You must be signed in to change notification settings - Fork 1
151 lines (125 loc) · 3.66 KB
/
designs.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
147
148
149
150
151
on:
workflow_dispatch:
name: 'All Designs'
defaults:
run:
shell: bash
env:
REGISTRY: ghcr.io
jobs:
designs:
name: Get design matrix
runs-on: ubuntu-latest
outputs:
designs: ${{ steps.designs.outputs.designs }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get design matrix
id: designs
run: |
echo "designs=$(python3 $GITHUB_WORKSPACE/generate_image_cache.py --github)" >> $GITHUB_OUTPUT
wheel:
name: Build wheel
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: hynek/build-and-inspect-python-package@v2
sc_version:
needs: wheel
name: Get SiliconCompiler version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.sc_version.outputs.version }}
steps:
- uses: actions/download-artifact@v4
with:
name: Packages
path: dist
- name: Install gallery
run: |
pip install --upgrade pip
pip install dist/*.whl
- name: Get version
id: sc_version
run: |
echo "version=v$(sc -version)" >> $GITHUB_OUTPUT
docker_image:
needs: sc_version
name: Get tools image
uses: siliconcompiler/siliconcompiler/.github/workflows/docker_image.yml@main
with:
sc_version: ${{ needs.sc_version.outputs.version }}
designs_test:
needs: [wheel, docker_image, designs]
runs-on: ubuntu-latest
container:
image: ${{ needs.docker_image.outputs.sc_tool }}
credentials:
username: ${{ secrets.PACKAGES_ACTOR }}
password: ${{ secrets.PACKAGES_TOKEN }}
strategy:
fail-fast: false
max-parallel: 50
matrix:
include: ${{ fromJson(needs.designs.outputs.designs) }}
name: 'Run design'
steps:
- uses: actions/download-artifact@v4
with:
name: Packages
path: dist
- name: Install gallery
run: |
pip install --upgrade pip
pip install dist/*.whl
- name: Run gallery
timeout-minutes: 120
run: |
REMOTE_ARGS=""
if [[ "${{ matrix.remote }}" = "true" ]] ; then
yes | sc-remote -configure -server https://server.siliconcompiler.com -credentials credentials.json
REMOTE_ARGS="-remote credentials.json"
fi
if [ -z "${{ matrix.target }}" ] ; then
sc-gallery -design ${{ matrix.design }} $REMOTE_ARGS
else
sc-gallery -design ${{ matrix.design }} -target ${{ matrix.target }} $REMOTE_ARGS
fi
- name: Generate artifact name
if: always()
run: |
if [ -z "${{ matrix.target }}" ] ; then
ART_NAME=${{ matrix.design }}
else
ART_NAME=${{ matrix.design }}-${{ matrix.target }}
fi
echo ART_NAME=${ART_NAME} >> $GITHUB_ENV # update GitHub ENV vars
- name: Upload gallery image
if: always()
uses: actions/upload-artifact@v4
with:
name: images-${{ env.ART_NAME }}
path: gallery/*/*.png
retention-days: 1
- name: Upload run artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: build-${{ env.ART_NAME }}
path: gallery/*/*.tgz
retention-days: 2
merge_images:
name: Merge image artifacts
runs-on: ubuntu-latest
if: always()
needs: designs_test
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
with:
name: images
pattern: images-*
delete-merged: true
retention-days: 7