summary refs log tree commit diff stats
path: root/.github
diff options
context:
space:
mode:
authorFederico Ceratto <federico.ceratto@gmail.com>2023-04-25 12:29:17 +0100
committerGitHub <noreply@github.com>2023-04-25 19:29:17 +0800
commitf0ae1ed54490bdce4f32cc7adf7ac3d85c706f3a (patch)
tree734e78f276621b0b535f9422d3c4426672259c32 /.github
parent897dff69dd3a284adb94392b085577068f792a1c (diff)
downloadNim-f0ae1ed54490bdce4f32cc7adf7ac3d85c706f3a.tar.gz
Add benchmarking based on Minimize (#21566)
* Add benchmarking based on Minimize

* Update .github/workflows/ci_bench.yml

Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>

---------

Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/ci_bench.yml117
1 files changed, 117 insertions, 0 deletions
diff --git a/.github/workflows/ci_bench.yml b/.github/workflows/ci_bench.yml
new file mode 100644
index 000000000..b044ab51f
--- /dev/null
+++ b/.github/workflows/ci_bench.yml
@@ -0,0 +1,117 @@
+name: Benchmarks CI
+on:
+  pull_request:
+  push:
+    branches:
+      - 'devel'
+
+jobs:
+  build:
+    strategy:
+      fail-fast: false
+      matrix:
+        os: [ubuntu-20.04]
+        cpu: [amd64]
+    name: '${{ matrix.os }}'
+    runs-on: ${{ matrix.os }}
+    timeout-minutes: 60 # refs bug #18178
+    steps:
+      - name: 'Checkout'
+        uses: actions/checkout@v3
+        with:
+          fetch-depth: 2
+
+      - name: 'Install node.js 16.x'
+        uses: actions/setup-node@v3
+        with:
+          node-version: '16.x'
+
+      - name: 'Install dependencies (Linux amd64)'
+        if: runner.os == 'Linux' && matrix.cpu == 'amd64'
+        run: |
+          sudo apt-fast update -qq
+          DEBIAN_FRONTEND='noninteractive' \
+            sudo apt-fast install --no-install-recommends -yq \
+              libcurl4-openssl-dev libgc-dev libsdl1.2-dev libsfml-dev \
+              valgrind libc6-dbg libblas-dev xorg-dev
+
+      - name: 'Add build binaries to PATH'
+        shell: bash
+        run: echo "${{ github.workspace }}/bin" >> "${GITHUB_PATH}"
+
+      - name: 'Build csourcesAny'
+        shell: bash
+        run: . ci/funs.sh && nimBuildCsourcesIfNeeded CC=gcc ucpu='${{ matrix.cpu }}'
+
+      - name: 'Build koch'
+        shell: bash
+        run: nim c koch
+
+      - name: 'Build Nim'
+        shell: bash
+        run: ./koch boot -d:release -d:nimStrictMode --lib:lib
+
+      - name: 'Build Nimble'
+        shell: bash
+        run: ./koch nimble
+
+      - name: 'Action'
+        shell: bash
+        run: nim c -r -d:release ci/action.nim
+
+      - name: 'Checkout minimize'
+        uses: actions/checkout@v3
+        with:
+          repository: 'nim-lang/ci_bench'
+          path: minimize
+
+      - name: 'Run minimize benchmarks'
+        shell: bash
+        run: ./minimize/minimize ci-bench
+
+      - name: 'Restore minimize cached database'
+        id: minimize-cache
+        uses: actions/cache/restore@v3
+        with:
+          path: minimize.sqlite
+          key: minimize-db-key
+
+      - name: 'Update minimize db'
+        shell: bash
+        run: ./minimize/minimize update-db
+
+            # - name: 'Save minimize cached database'
+            #if: |
+            #  github.event_name == 'push' && github.ref == 'refs/heads/devel' &&
+            #  matrix.target == 'linux'
+            #   id: minimize-cache
+            #   uses: actions/cache/save@v3
+            #   with:
+            #     path: minimize.sqlite
+            #     key: minimize-db-key
+
+      - name: 'Generate minimize report'
+        shell: bash
+        run: ./minimize/minimize generate-report
+
+      - name: 'Archive minimize report'
+        uses: actions/upload-artifact@v3
+        with:
+          name: minimize-report
+          path: |
+            minimize/minimize.html
+            minimize/minimize.csv
+
+      # Requires additional permissions, see:
+      # https://github.com/nim-lang/Nim/actions/runs/4778177321/jobs/8494423792?pr=21566
+      # - name: 'Publish HTML report'
+      #   uses: rossjrw/pr-preview-action@v1
+      #   with:
+      #     source-dir: minimize
+      #     umbrella-dir: minimize
+      #   env:
+      #     GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+      - name: Extract md summary
+        run: |
+          cat minimize/summary.md  >> $GITHUB_STEP_SUMMARY
previous revision' href='/ahoang/Nim/blame/tools/ci_generate.nim?h=devel&id=04deb6c9421d0a11cedfc7e8c52ae3b30e7bf1db'>^
c49562825 ^
89a15e417 ^





1f1d85bb9 ^

ec2bc2a50 ^
1f1d85bb9 ^

















b88496ac6 ^
1f1d85bb9 ^



















b72ecaf63 ^
13b57524d ^
1f1d85bb9 ^













89a15e417 ^
d0485e326 ^
ac82be07d ^

89a15e417 ^
bbe49a14a ^
d0485e326 ^
























1f1d85bb9 ^
89a15e417 ^
d0485e326 ^

1f1d85bb9 ^


89a15e417 ^


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