-
Notifications
You must be signed in to change notification settings - Fork 2
135 lines (130 loc) · 4.32 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Build documentation
on:
workflow_dispatch:
push:
branches:
- main
tags:
- v**
pull_request:
branches:
- main
jobs:
build_latex:
runs-on: ubuntu-latest
steps:
- name: Set up Git repository
uses: actions/checkout@v4
- name: Cache documentation build
uses: actions/cache@v4
with:
key: "doc-pdf-v1-${{ hashFiles('docs/**') }}"
restore-keys: "doc-pdf-v1"
path: docs/build
- name: Touch source to ensure at least 1 build
run: touch docs/SMAesH.tex
- name: Compile LaTeX document
uses: xu-cheng/latex-action@v3
with:
working_directory: docs
root_file: SMAesH.tex
args: -auxdir=build -pdf -file-line-error -halt-on-error -interaction=nonstopmode
- name: Upload PDF file
uses: actions/upload-artifact@v4
with:
name: docs
path: docs/SMAesH.pdf
sbox:
runs-on: ubuntu-24.04
strategy:
fail-fast: true
matrix:
nshares: [2]
env:
NSHARES: "${{ matrix.nshares }}"
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
submodules: true
- name: Get COMPRESS version
id: compress-version
run: |
echo "cv=$(git -C sboxes-compress/compress show-ref HEAD | cut -d ' ' -f 1)" >> $GITHUB_OUTPUT
shell: bash
- run: sudo apt-get install -y yosys
- name: Cache COMPRESS Sbox
uses: actions/cache@v4
with:
key: "sbox-compress-v1-d${{ matrix.nshares }}-${{ hashFiles('sboxes-compress/canright_aes_sbox_dual.v') }}-${{ steps.compress-version.outputs.cv }}"
path: work/d${{ matrix.nshares }}/sbox
- run: make sbox DIR_MATCHI_ROOT=.
- name: Upload COMPRESS sbox
uses: actions/upload-artifact@v4
with:
name: sbox_${{ matrix.nshares }}
path: work/d${{ matrix.nshares }}/sbox/*
functest:
needs: [sbox]
runs-on: ubuntu-24.04
strategy:
fail-fast: true
matrix:
nshares: [2]
env:
NSHARES: "${{ matrix.nshares }}"
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
submodules: true
- uses: actions/download-artifact@v4
with:
name: sbox_${{ matrix.nshares }}
path: work/d${{ matrix.nshares }}/sbox
- run: sudo apt-get install -y yosys verilator iverilog
- run: make func-tests DIR_MATCHI_ROOT=.
formal_verif_matchi:
needs: [sbox]
runs-on: ubuntu-24.04
strategy:
fail-fast: true
matrix:
nshares: [2]
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
submodules: true
- uses: actions/download-artifact@v4
with:
name: sbox_${{ matrix.nshares }}
path: work/d${{ matrix.nshares }}/sbox
- run: sudo apt-get install -y yosys iverilog python3.12-venv
- run: mkdir -p ${{ github.workspace }}/verif-tools
- run: wget https://github.com/cassiersg/matchi/releases/download/v0.1.0/matchi -P ${{ github.workspace }}/verif-tools
- run: chmod +x ${{ github.workspace }}/verif-tools/matchi
- run: (cd ${{ github.workspace }}/verif-tools; curl -L https://github.com/cassiersg/matchi/archive/refs/tags/v0.1.0.tar.gz | tar xz)
- run: (curl -L https://github.com/simple-crypto/hw-devtools/releases/download/v241002-5/hw-devtools.tar.gz | tar xz; sudo apt install ./hw-devtools/*.deb)
- run: mkdir -p work
- run: verilator --version > work/verilator_version
- run: yosys --version > work/yosys_version
- run: make formal-tests DIR_MATCHI_ROOT=. MATCHI_CELLS=${{ github.workspace }}/verif-tools/matchi-0.1.0/matchi_cells MATCHI_BIN=${{ github.workspace }}/verif-tools/matchi
release:
needs: [build_latex, functest]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: docs
path: release
- name: Release
uses: softprops/action-gh-release@v2
with:
body: |
View CHANGELOG.md for full changes.
files: |
release/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}