Skip to content

Commit b97b050

Browse files
committed
Merge bitcoin/bitcoin#28187: ci: Run "macOS native x86_64" job on GitHub Actions
9658d0d ci: Run "macOS native x86_64" job on GitHub Actions (Hennadii Stepanov) Pull request description: From bitcoin/bitcoin#28098: > Thus, someone would have to sponsor an amount of roughly 5kUSD/mo for those two tasks. > If the goal is to stay on a free plan, I think the only option is GitHub Actions CI. --- **IMPORTANT NOTE**. We currently ship macOS release binaries for both architectures: `x86_64` and `arm64`. If this PR gets merged, only `x86_64` architecture will be tested on CI, which implies some [drawbacks](bitcoin/bitcoin#28187 (comment)). However, it has never been the case that our CI tested both architectures simultaneously. And we hope that GitHub Actions will soon host macOS `arm64` runners. Historically, we moved from `x86_64` to `arm64` in bitcoin/bitcoin#26388 less than a year ago. --- Security concerns: - bitcoin/bitcoin#28098 (comment) - bitcoin/bitcoin#28098 (comment) `GITHUB_TOKEN` permissions (from the build log in my personal repo): ``` 2023-07-27T07:30:17.8313534Z ##[group]GITHUB_TOKEN Permissions 2023-07-27T07:30:17.8314113Z Contents: read 2023-07-27T07:30:17.8314608Z Metadata: read 2023-07-27T07:30:17.8314957Z Packages: read 2023-07-27T07:30:17.8315233Z ##[endgroup] ``` Comparison of resources: | Resource | Current, Cirrus CI | Suggested, GitHub Actions | |---|:-:|:-:| | CPU | 4 | 4 \*\* | | RAM, GB | 8 | 14 | **\*\* NOTE**: However, [docs](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources) are mentioning: > 3-core CPU (x86_64) ACKs for top commit: MarcoFalke: re-ACK 9658d0d 🏂 achow101: ACK 9658d0d jarolrod: ACK 9658d0d Tree-SHA512: 6123e68e6784cdf4e53c3e77b435709261db21f09091af2c22e667d3816a305fffb9d617297a5bc1bda18aaba84a6e210cec6a75c52afa7746a3780a67b69865
2 parents cd43a84 + 9658d0d commit b97b050

File tree

3 files changed

+62
-20
lines changed

3 files changed

+62
-20
lines changed

.cirrus.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -328,20 +328,3 @@ task:
328328
FILE_ENV: "./ci/test/00_setup_env_mac.sh"
329329
env:
330330
<< : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV
331-
332-
task:
333-
name: 'macOS 13 native arm64 [gui, sqlite only] [no depends]'
334-
macos_instance:
335-
# Use latest image, but hardcode version to avoid silent upgrades (and breaks)
336-
image: ghcr.io/cirruslabs/macos-ventura-xcode:14.3.1 # https://cirrus-ci.org/guide/macOS
337-
<< : *BASE_TEMPLATE
338-
check_clang_script:
339-
- clang --version
340-
brew_install_script:
341-
- brew install boost libevent qt@5 miniupnpc libnatpmp ccache zeromq qrencode libtool automake gnu-getopt
342-
<< : *MAIN_TEMPLATE
343-
env:
344-
<< : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV
345-
CI_USE_APT_INSTALL: "no"
346-
PACKAGE_MANAGER_INSTALL: "echo" # Nothing to do
347-
FILE_ENV: "./ci/test/00_setup_env_mac_native_arm64.sh"

.github/workflows/ci.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Copyright (c) 2023 The Bitcoin Core developers
2+
# Distributed under the MIT software license, see the accompanying
3+
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
4+
5+
name: CI
6+
on:
7+
# See: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request.
8+
pull_request:
9+
# See: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push.
10+
push:
11+
branches:
12+
- '**'
13+
tags-ignore:
14+
- '**'
15+
16+
env:
17+
DANGER_RUN_CI_ON_HOST: 1
18+
TEST_RUNNER_TIMEOUT_FACTOR: 40
19+
20+
jobs:
21+
macos-native-x86_64:
22+
name: macOS 13 native, x86_64 [no depends, sqlite only, gui]
23+
# Use latest image, but hardcode version to avoid silent upgrades (and breaks).
24+
# See: https://github.com/actions/runner-images#available-images.
25+
runs-on: macos-13
26+
27+
# No need to run on the read-only mirror, unless it is a PR.
28+
if: github.repository != 'bitcoin-core/gui' || github.event_name == 'pull_request'
29+
30+
timeout-minutes: 120
31+
32+
env:
33+
MAKEJOBS: '-j4'
34+
CI_USE_APT_INSTALL: 'no'
35+
PACKAGE_MANAGER_INSTALL: 'echo' # Nothing to do
36+
FILE_ENV: './ci/test/00_setup_env_mac_native.sh'
37+
38+
steps:
39+
- name: Checkout
40+
uses: actions/checkout@v3
41+
42+
- name: Clang version
43+
run: clang --version
44+
45+
- name: Install Homebrew packages
46+
run: brew install boost libevent qt@5 miniupnpc libnatpmp ccache zeromq qrencode libtool automake gnu-getopt
47+
48+
- name: Set Ccache directory
49+
run: echo "CCACHE_DIR=${RUNNER_TEMP}/ccache_dir" >> "$GITHUB_ENV"
50+
51+
- name: Ccache cache
52+
uses: actions/cache@v3
53+
with:
54+
path: ${{ env.CCACHE_DIR }}
55+
key: ${{ github.job }}-ccache-cache-${{ github.run_id }}
56+
restore-keys: ${{ github.job }}-ccache-cache
57+
58+
- name: CI script
59+
run: ./ci/test_run_all.sh
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
#!/usr/bin/env bash
22
#
3-
# Copyright (c) 2019-2022 The Bitcoin Core developers
3+
# Copyright (c) 2019-present The Bitcoin Core developers
44
# Distributed under the MIT software license, see the accompanying
55
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
66

77
export LC_ALL=C.UTF-8
88

9-
export HOST=arm64-apple-darwin
9+
export HOST=x86_64-apple-darwin
1010
export PIP_PACKAGES="zmq"
1111
export GOAL="install"
1212
export BITCOIN_CONFIG="--with-gui --with-miniupnpc --with-natpmp --enable-reduce-exports"
1313
export CI_OS_NAME="macos"
1414
export NO_DEPENDS=1
1515
export OSX_SDK=""
16-
export CCACHE_MAXSIZE=300M
16+
export CCACHE_MAXSIZE=400M
1717
export RUN_FUZZ_TESTS=true
1818
export FUZZ_TESTS_CONFIG="--exclude banman" # https://github.com/bitcoin/bitcoin/issues/27924

0 commit comments

Comments
 (0)