Skip to content

Commit

Permalink
Add consistent testing to actions
Browse files Browse the repository at this point in the history
  • Loading branch information
x-mass committed Nov 28, 2023
1 parent 1d6b9fa commit 22745fb
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 7 deletions.
39 changes: 33 additions & 6 deletions .github/workflows/build_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,20 @@ concurrency:
cancel-in-progress: true

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-linux:
runs-on: [ self-hosted, Linux, amd64 ]

needs:
- handle-syncwith

env:
CONTAINER_TMP: /opt/
HOST_TMP: /home/runner/work/_temp/
Expand Down Expand Up @@ -49,21 +60,37 @@ jobs:
cmake --version
- name: Checkout sources
# We need full history, because during CMake config stage we are finding the nearest tag
uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: 0

- name: Clean index.lock files if checkout step was cancelled or failed
if: cancelled() || failure()
run: |
find .git -name 'index.lock' -exec rm -v {} \;
submodules: false

# Workaround: https://github.com/actions/checkout/issues/1169
- name: Mark directory as safe
run: |
git config --system --add safe.directory $PWD
- name: Checkout submodules
run: |
git submodule update --init --recursive --depth=1
- name: Checkout modules to specified refs
if: needs.handle-syncwith.outputs.prs-refs != ''
uses: NilFoundation/ci-cd/actions/recursive-checkout@v1
# TODO: figure out the mapping of volumes and use variable here, not hardcoded path
with:
paths: |
/__w/zkLLVM/zkLLVM/**
!/__w/zkLLVM/zkLLVM/
!/__w/zkLLVM/zkLLVM/**/.git/**
refs: ${{ needs.handle-syncwith.outputs.prs-refs }}

- name: Clean index.lock files if checkout step was cancelled or failed
if: cancelled() || failure()
run: |
find .git -name 'index.lock' -exec rm -v {} \;
- name: Install boost
uses: MarkusJx/[email protected]
id: install-boost
Expand Down
29 changes: 28 additions & 1 deletion .github/workflows/build_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,21 @@ concurrency:
cancel-in-progress: true

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'
fetch-only: true
secrets: inherit

build-macos:
runs-on: [ macos-11 ]

needs:
- handle-syncwith

steps:
- name: Install homebrew
run: >
Expand Down Expand Up @@ -49,10 +61,25 @@ jobs:
echo PATH: $PATH
- name: Checkout sources
# We need full history, because during CMake config stage we are finding the nearest tag
uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: 0
submodules: false

- name: Checkout submodules
run: |
git submodule update --init --recursive --depth=1
- name: Checkout modules to specified refs
if: needs.handle-syncwith.outputs.prs-refs != ''
uses: NilFoundation/ci-cd/actions/recursive-checkout@v1
with:
paths: |
${{ github.workspace }}/**
!${{ github.workspace }}
!${{ github.workspace }}/**/.git/**
refs: ${{ needs.handle-syncwith.outputs.prs-refs }}

- name: Enable ccache
uses: hendrikmuhs/[email protected]
Expand Down

0 comments on commit 22745fb

Please sign in to comment.