@@ -3,26 +3,97 @@ on: push
33
44jobs :
55 configure :
6- runs-on : ubuntu-latest
6+ runs-on : ${{ github.repository_owner == 'zondax' && 'zondax-runners' || ' ubuntu-latest' }}
77 outputs :
88 uid_gid : ${{ steps.get-user.outputs.uid_gid }}
99 steps :
1010 - id : get-user
1111 run : echo "uid_gid=$(id -u):$(id -g)" >> $GITHUB_OUTPUT
1212
13+ setup :
14+ runs-on : ${{ github.repository_owner == 'zondax' && 'zondax-runners' || 'ubuntu-latest' }}
15+ steps :
16+ - name : Checkout
17+ uses : actions/checkout@v4
18+ with :
19+ submodules : true
20+ - name : Cache APT packages
21+ uses : actions/cache@v4
22+ with :
23+ path : /var/cache/apt/archives
24+ key : ${{ runner.os }}-apt-${{ hashFiles('**/main.yml') }}
25+ restore-keys : |
26+ ${{ runner.os }}-apt-
27+ - name : Install dependencies
28+ run : |
29+ sudo apt-get update
30+ sudo apt-get install -y curl protobuf-compiler build-essential git wget unzip python3 python3-pip \
31+ libssl-dev libffi-dev libreadline-dev zlib1g-dev libbz2-dev libsqlite3-dev libncurses5-dev \
32+ libgdbm-dev libnss3-dev liblzma-dev libxml2-dev libxmlsec1-dev libffi-dev libyaml-dev
33+ - name : Cache CMake installation
34+ uses : actions/cache@v4
35+ id : cmake-cache
36+ with :
37+ path : /opt/cmake
38+ key : cmake-3.28.0-${{ runner.os }}
39+ - name : Install CMake 3.28
40+ if : steps.cmake-cache.outputs.cache-hit != 'true'
41+ run : |
42+ wget https://github.com/Kitware/CMake/releases/download/v3.28.0/cmake-3.28.0-linux-x86_64.sh
43+ sudo mkdir -p /opt/cmake
44+ sudo sh cmake-3.28.0-linux-x86_64.sh --skip-license --prefix=/opt/cmake
45+ - name : Setup CMake symlinks
46+ run : |
47+ sudo ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake
48+ sudo ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest
49+ - name : Verify CMake version
50+ run : cmake --version
51+
1352 build :
14- runs-on : ubuntu-latest
53+ runs-on : ${{ github.repository_owner == 'zondax' && 'zondax-runners' || 'ubuntu-latest' }}
54+ needs : setup
1555 steps :
1656 - name : Checkout
1757 uses : actions/checkout@v4
1858 with :
1959 submodules : true
60+ - name : Restore APT cache
61+ uses : actions/cache@v4
62+ with :
63+ path : /var/cache/apt/archives
64+ key : ${{ runner.os }}-apt-${{ hashFiles('**/main.yml') }}
65+ restore-keys : |
66+ ${{ runner.os }}-apt-
67+ - name : Install dependencies
68+ run : |
69+ sudo apt-get update
70+ sudo apt-get install -y curl protobuf-compiler build-essential git wget unzip python3 python3-pip \
71+ libssl-dev libffi-dev libreadline-dev zlib1g-dev libbz2-dev libsqlite3-dev libncurses5-dev \
72+ libgdbm-dev libnss3-dev liblzma-dev libxml2-dev libxmlsec1-dev libffi-dev libyaml-dev
73+ - name : Restore CMake cache
74+ uses : actions/cache@v4
75+ id : cmake-cache-restore
76+ with :
77+ path : /opt/cmake
78+ key : cmake-3.28.0-${{ runner.os }}
79+ - name : Install CMake 3.28 (if cache miss)
80+ if : steps.cmake-cache-restore.outputs.cache-hit != 'true'
81+ run : |
82+ wget https://github.com/Kitware/CMake/releases/download/v3.28.0/cmake-3.28.0-linux-x86_64.sh
83+ sudo mkdir -p /opt/cmake
84+ sudo sh cmake-3.28.0-linux-x86_64.sh --skip-license --prefix=/opt/cmake
85+ - name : Setup CMake symlinks
86+ run : |
87+ sudo ln -sf /opt/cmake/bin/cmake /usr/local/bin/cmake
88+ sudo ln -sf /opt/cmake/bin/ctest /usr/local/bin/ctest
89+ - name : Verify CMake version
90+ run : cmake --version
2091 - run : make build
2192 - name : Run C++ tests
2293 run : make test
2394
2495 check_version :
25- runs-on : ubuntu-latest
96+ runs-on : ${{ github.repository_owner == 'zondax' && 'zondax-runners' || ' ubuntu-latest' }}
2697 outputs :
2798 version : ${{ steps.get-version.outputs.version }}
2899 exists : ${{ steps.get-version.outputs.exists }}
48119 run : exit 1
49120
50121 tag :
51- runs-on : ubuntu-latest
122+ runs-on : ${{ github.repository_owner == 'zondax' && 'zondax-runners' || ' ubuntu-latest' }}
52123 needs :
53124 - build
54125 - check_version
0 commit comments