Skip to content

Commit 48b53fc

Browse files
committed
use zondax runners
1 parent fa39dd8 commit 48b53fc

3 files changed

Lines changed: 79 additions & 7 deletions

File tree

.github/workflows/lint.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ permissions:
1414

1515
jobs:
1616
lint:
17-
runs-on: ubuntu-latest
17+
runs-on: ${{ github.repository_owner == 'zondax' && 'zondax-runners' || 'ubuntu-latest' }}
1818
steps:
1919
- uses: actions/checkout@v4
2020
with:
@@ -27,7 +27,8 @@ jobs:
2727
build-essential \
2828
cmake \
2929
clang-format \
30-
clang-tidy
30+
clang-tidy \
31+
wget
3132
3233
- name: Lint and format 💅
3334
uses: cpp-linter/cpp-linter-action@v2

.github/workflows/main.yml

Lines changed: 75 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,97 @@ on: push
33

44
jobs:
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 }}
@@ -48,7 +119,7 @@ jobs:
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

include/zxversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717

1818
#define ZXLIB_MAJOR 36
1919
#define ZXLIB_MINOR 0
20-
#define ZXLIB_PATCH 5
20+
#define ZXLIB_PATCH 6

0 commit comments

Comments
 (0)