-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8a3c405
commit c2c1175
Showing
2 changed files
with
80 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: Run tests | ||
|
||
on: | ||
# Triggers the workflow on pull request events but only for the master branch | ||
pull_request: | ||
branches: [ master ] | ||
push: | ||
branches: [ master ] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
env: | ||
SUITE_REPO: "NilFoundation/crypto3" | ||
LIB_NAME: "blueprint" | ||
CACHE_NAME: "blueprint-job-cache" | ||
TESTS_ARTIFACT_NAME: "test-results-mac" | ||
|
||
jobs: | ||
handle-syncwith: | ||
if: github.event_name == 'pull_request' | ||
name: Call Reusable SyncWith Handler | ||
uses: NilFoundation/ci-cd/.github/workflows/reusable-handle-syncwith.yml@v1 | ||
with: | ||
ci-cd-ref: 'v1' | ||
secrets: inherit | ||
|
||
build-and-test: | ||
needs: [ handle-syncwith ] | ||
name: "Build and test macOS" | ||
runs-on: [macos-14] | ||
strategy: | ||
fail-fast: false | ||
steps: | ||
# https://github.com/actions/checkout/issues/1552 | ||
- name: Clean up after previous checkout | ||
run: chmod +w -R ${GITHUB_WORKSPACE}; rm -rf ${GITHUB_WORKSPACE}/*; | ||
|
||
- name: Checkout Blueprint | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
submodules: recursive | ||
|
||
- name: Checkout submodules to specified refs | ||
if: inputs.submodules-refs != '' | ||
uses: NilFoundation/ci-cd/actions/[email protected] | ||
with: | ||
refs: ${{ inputs.submodules-refs }} | ||
paths: | | ||
${{ github.workspace }}/** | ||
!${{ github.workspace }}/ | ||
!${{ github.workspace }}/**/.git/** | ||
# nix is taken from the cloud-init template, no need to install it. | ||
- name: Build and run tests | ||
run: | | ||
nix build -L .?submodules=1#checks.aarch64-darwin.$check_name | ||
results_dir="./results" | ||
mkdir -p "$results_dir" | ||
cp -r ./result/* "$results_dir/all-checks" | ||
rm -rf result | ||
- name: Publish Test Results | ||
uses: EnricoMi/publish-unit-test-result-action/linux@v2 | ||
with: | ||
check_name: "Mac Test Results" | ||
files: "results/**/*.xml" | ||
comment_mode: ${{ github.event.pull_request.head.repo.fork && 'off' || 'always' }} # Don't create PR comment from fork runs | ||
action_fail_on_inconclusive: true # fail, if no reports | ||
action_fail: true | ||
- name: 'Upload Artifacts' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: junit-test-results | ||
path: "results/**/*.xml" | ||
retention-days: 5 | ||
if-no-files-found: error | ||
overwrite: true |