Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

Commit c2c1175

Browse files
add mac build job
1 parent 8a3c405 commit c2c1175

File tree

2 files changed

+80
-1
lines changed

2 files changed

+80
-1
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ env:
1414
SUITE_REPO: "NilFoundation/crypto3"
1515
LIB_NAME: "blueprint"
1616
CACHE_NAME: "blueprint-job-cache"
17+
TESTS_ARTIFACT_NAME: "test-results-linux"
1718

1819
jobs:
1920
handle-syncwith:
@@ -26,14 +27,14 @@ jobs:
2627

2728
build-and-test:
2829
needs: [ handle-syncwith ]
30+
name: "Build and test Linux"
2931
runs-on: ["self-hosted", "aws_autoscaling"]
3032
strategy:
3133
fail-fast: false
3234
steps:
3335
# https://github.com/actions/checkout/issues/1552
3436
- name: Clean up after previous checkout
3537
run: chmod +w -R ${GITHUB_WORKSPACE}; rm -rf ${GITHUB_WORKSPACE}/*;
36-
3738
- name: Checkout Blueprint
3839
uses: actions/checkout@v4
3940
with:
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Run tests
2+
3+
on:
4+
# Triggers the workflow on pull request events but only for the master branch
5+
pull_request:
6+
branches: [ master ]
7+
push:
8+
branches: [ master ]
9+
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
env:
14+
SUITE_REPO: "NilFoundation/crypto3"
15+
LIB_NAME: "blueprint"
16+
CACHE_NAME: "blueprint-job-cache"
17+
TESTS_ARTIFACT_NAME: "test-results-mac"
18+
19+
jobs:
20+
handle-syncwith:
21+
if: github.event_name == 'pull_request'
22+
name: Call Reusable SyncWith Handler
23+
uses: NilFoundation/ci-cd/.github/workflows/reusable-handle-syncwith.yml@v1
24+
with:
25+
ci-cd-ref: 'v1'
26+
secrets: inherit
27+
28+
build-and-test:
29+
needs: [ handle-syncwith ]
30+
name: "Build and test macOS"
31+
runs-on: [macos-14]
32+
strategy:
33+
fail-fast: false
34+
steps:
35+
# https://github.com/actions/checkout/issues/1552
36+
- name: Clean up after previous checkout
37+
run: chmod +w -R ${GITHUB_WORKSPACE}; rm -rf ${GITHUB_WORKSPACE}/*;
38+
39+
- name: Checkout Blueprint
40+
uses: actions/checkout@v4
41+
with:
42+
fetch-depth: 0
43+
submodules: recursive
44+
45+
- name: Checkout submodules to specified refs
46+
if: inputs.submodules-refs != ''
47+
uses: NilFoundation/ci-cd/actions/recursive-checkout@v1.2.1
48+
with:
49+
refs: ${{ inputs.submodules-refs }}
50+
paths: |
51+
${{ github.workspace }}/**
52+
!${{ github.workspace }}/
53+
!${{ github.workspace }}/**/.git/**
54+
55+
# nix is taken from the cloud-init template, no need to install it.
56+
- name: Build and run tests
57+
run: |
58+
nix build -L .?submodules=1#checks.aarch64-darwin.$check_name
59+
results_dir="./results"
60+
mkdir -p "$results_dir"
61+
cp -r ./result/* "$results_dir/all-checks"
62+
rm -rf result
63+
- name: Publish Test Results
64+
uses: EnricoMi/publish-unit-test-result-action/linux@v2
65+
with:
66+
check_name: "Mac Test Results"
67+
files: "results/**/*.xml"
68+
comment_mode: ${{ github.event.pull_request.head.repo.fork && 'off' || 'always' }} # Don't create PR comment from fork runs
69+
action_fail_on_inconclusive: true # fail, if no reports
70+
action_fail: true
71+
- name: 'Upload Artifacts'
72+
uses: actions/upload-artifact@v4
73+
with:
74+
name: junit-test-results
75+
path: "results/**/*.xml"
76+
retention-days: 5
77+
if-no-files-found: error
78+
overwrite: true

0 commit comments

Comments
 (0)