-
Notifications
You must be signed in to change notification settings - Fork 2
130 lines (115 loc) · 4.81 KB
/
Copy pathbenchmark.yml
File metadata and controls
130 lines (115 loc) · 4.81 KB
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
name: Benchmark
on:
push:
branches: [ "**" ]
pull_request:
branches: [ "**" ]
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
compiler: clang
name: "Ubuntu Clang"
- os: ubuntu-latest
compiler: gcc
name: "Ubuntu GNU"
- os: macos-latest
compiler: clang
name: "macOS Clang"
- os: macos-latest
compiler: gcc
name: "macOS GNU"
- os: windows-latest
compiler: msvc
name: "Windows MSVC"
runs-on: ${{ matrix.os }}
name: Build on ${{ matrix.name }}
steps:
- name: Checkout Repository
uses: actions/checkout@v7
- name: Setup Clang (Ubuntu)
if: matrix.os == 'ubuntu-latest' && matrix.compiler == 'clang'
run: |
wget https://apt.llvm.org/llvm.sh
chmod u+x llvm.sh
DEV_VERSION=$(awk -F'[][]' '/LLVM_VERSION_PATTERNS/ {print $2}' llvm.sh | sort -n | tail -n 1)
sudo ./llvm.sh $DEV_VERSION
echo "CXX_BIN=/usr/bin/clang++-$DEV_VERSION" >> $GITHUB_ENV
- name: Setup GNU (Ubuntu)
if: matrix.os == 'ubuntu-latest' && matrix.compiler == 'gcc'
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update
DEV_VERSION=$(apt-cache search '^g\+\+-[0-9]+$' | awk '{print $1}' | sort -V | tail -n 1 | sed 's/g++-//')
sudo apt-get install -y gcc-$DEV_VERSION g++-$DEV_VERSION
echo "CXX_BIN=/usr/bin/g++-$DEV_VERSION" >> $GITHUB_ENV
- name: Setup Clang (macOS)
if: matrix.os == 'macos-latest' && matrix.compiler == 'clang'
run: |
brew install llvm
echo "CXX_BIN=$(brew --prefix llvm)/bin/clang++" >> $GITHUB_ENV
- name: Setup GNU (macOS)
if: matrix.os == 'macos-latest' && matrix.compiler == 'gcc'
run: |
brew install gcc
GCC_VERSION=$(brew list --versions gcc | awk '{print $2}' | cut -d. -f1)
echo "CXX_BIN=g++-$GCC_VERSION" >> $GITHUB_ENV
- name: Setup MSVC (Windows)
if: matrix.os == 'windows-latest'
uses: ilammy/msvc-dev-cmd@v1
- name: Configure CMake (Unix)
if: runner.os != 'Windows'
run: cmake -S . -B ./Build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=${{ env.CXX_BIN }} -DBNCH_SWT_BENCHMARKS=TRUE -DPRINT_ASSEMBLY=TRUE
- name: Configure CMake (Windows)
if: runner.os == 'Windows'
run: cmake -S . -B ./Build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=${{ matrix.cmake_cxx }} -DBNCH_SWT_BENCHMARKS=TRUE -DPRINT_ASSEMBLY=TRUE
- name: Build
run: cmake --build ./Build --config=Release -v
- name: Find and Print Assembly Files (Unix)
if: runner.os != 'Windows'
run: |
echo "=== Searching for assembly files ==="
find ./Build -name "*.asm" -type f
echo ""
echo "=== Assembly file details ==="
find ./Build -name "*.asm" -type f -exec sh -c 'echo "File: {}"; ls -lh "{}"; echo "Lines: $(wc -l < "{}")"; echo ""' \;
echo ""
echo "=== Printing COMPLETE assembly files ==="
find ./Build -name "*.asm" -type f -exec sh -c 'echo "========== {} =========="; cat "{}"; echo ""; echo "========== END OF {} =========="; echo ""' \;
- name: Find and Print Assembly Files (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
echo "=== Searching for assembly files ==="
$asmFiles = Get-ChildItem -Path ./Build -Recurse -Filter "*.cod" -File -ErrorAction SilentlyContinue
if ($null -eq $asmFiles -or $asmFiles.Count -eq 0) {
echo "NO .COD FILES FOUND!"
} else {
echo "Found $($asmFiles.Count) assembly file(s):"
$asmFiles | ForEach-Object { echo $_.FullName }
echo ""
echo "=== Printing COMPLETE assembly files ==="
$asmFiles | ForEach-Object {
echo "========== $($_.FullName) =========="
Get-Content $_.FullName
echo "========== END OF $($_.FullName) =========="
echo ""
}
}
- name: Install
run: |
${{ runner.os != 'Windows' && 'sudo' || '' }} cmake --install ./Build --config=Release
- name: Run (Unix)
if: runner.os != 'Windows'
run: |
sudo chmod +x /usr/local/bin/benchmarksuite-main
/usr/local/bin/benchmarksuite-main
- name: Run (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
& "C:/Program Files (x86)/benchmarksuite/bin/benchmarksuite-main.exe"