Skip to content

Commit 6ea3425

Browse files
committed
added self hosted runners config
Signed-off-by: Lior Sventitzky <liorsve@amazon.com>
1 parent 8cd2a73 commit 6ea3425

File tree

9 files changed

+65
-25
lines changed

9 files changed

+65
-25
lines changed

.github/json_matrices/build-matrix.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@
1919
"PACKAGE_MANAGERS": ["pypi", "npm", "maven", "pkg_go_dev"],
2020
"languages": ["python", "node", "java", "go"]
2121
},
22+
{
23+
"OS": "macos",
24+
"NAMED_OS": "darwin",
25+
"RUNNER": ["self-hosted", "macOS", "ARM64", "ephemeral"],
26+
"ARCH": "arm64",
27+
"TARGET": "aarch64-apple-darwin",
28+
"PACKAGE_MANAGERS": ["pypi", "npm", "maven", "pkg_go_dev"],
29+
"languages": ["python", "node", "java", "go"]
30+
},
2231
{
2332
"OS": "macos",
2433
"NAMED_OS": "darwin",

.github/workflows/create-test-matrices/action.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ inputs:
1414
required: true
1515
type: boolean
1616
run-with-macos:
17-
description: "Run with macos included"
18-
type: boolean
17+
type: choice
18+
options:
19+
- false
20+
- on self hosted runners
21+
- on github runners
1922
default: false
2023
containers:
2124
description: "Run in containers"
@@ -83,10 +86,13 @@ runs:
8386
fi
8487
8588
# Add macOS runners if specified
86-
if [[ "$RUN_WITH_MACOS" == "true" ]]; then
87-
echo "Including macOS runners separately"
88-
MAC_RUNNERS=$(jq --arg lang "$LANGUAGE_NAME" -c '[.[] | select(.languages? and any(.languages[] == $lang; .) and '"$CONDITION"' and .TARGET == "aarch64-apple-darwin")]' < .github/json_matrices/build-matrix.json)
89-
89+
if [[ "$RUN_WITH_MACOS" == "on self hosted runners" ]]; then
90+
echo "Including only self-hosted macOS runners"
91+
MAC_RUNNERS=$(jq --arg lang "$LANGUAGE_NAME" -c '[.[] | select(.languages? and any(.languages[] == $lang; .) and '"$CONDITION"' and .TARGET == "aarch64-apple-darwin" and (.RUNNER == ["self-hosted","macOS","ARM64","ephemeral"]))]' < .github/json_matrices/build-matrix.json)
92+
FINAL_MATRIX=$(echo "$BASE_MATRIX" "$MAC_RUNNERS" | jq -sc 'add')
93+
elif [[ "$RUN_WITH_MACOS" == "on github runners" ]]; then
94+
echo "Including only GitHub-hosted macOS runners"
95+
MAC_RUNNERS=$(jq --arg lang "$LANGUAGE_NAME" -c '[.[] | select(.languages? and any(.languages[] == $lang; .) and '"$CONDITION"' and .TARGET == "aarch64-apple-darwin" and .RUNNER == "macos-15")]' < .github/json_matrices/build-matrix.json)
9096
FINAL_MATRIX=$(echo "$BASE_MATRIX" "$MAC_RUNNERS" | jq -sc 'add')
9197
else
9298
FINAL_MATRIX="$BASE_MATRIX"

.github/workflows/full-matrix-tests-sweeper.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jobs:
4444
ref: branch, // The branch where workflow_dispatch is triggered
4545
inputs: {
4646
'run-modules-tests': 'false' // Dont run modules tests
47+
'run-with-macos': 'on self hosted runners'
4748
}
4849
});
4950
console.log(`Successfully triggered workflow for branch: ${branch}`);

.github/workflows/full-matrix-tests.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ on:
1414
default: true
1515

1616
run-with-macos:
17-
description: "Run with macos included (only when necessary)"
18-
type: boolean
17+
description: "Run with macos inclauded (only when necessary)"
18+
type: choice
19+
options:
20+
- false
21+
- on self hosted runners
22+
- on github runners
1923
default: false
2024

2125
run-modules-tests:

.github/workflows/go.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ on:
4343
default: false
4444
run-with-macos:
4545
description: "Run with macos included (only when needed)"
46-
type: boolean
46+
type: choice
47+
options:
48+
- false
49+
- on self hosted runners
50+
- on github runners
4751
default: false
4852
rc-version:
4953
required: false
@@ -61,8 +65,8 @@ on:
6165
workflow_call:
6266
inputs:
6367
run-with-macos:
64-
description: "Run with macos included (only when needed)"
65-
type: boolean
68+
description: "Run with macos included (only when necessary)"
69+
type: string
6670
default: false
6771

6872
concurrency:
@@ -92,7 +96,7 @@ jobs:
9296
language-name: go
9397
# Run full test matrix if job started by cron or it was explictly specified by a person who triggered the workflow
9498
run-full-matrix: ${{ github.event.inputs.full-matrix == 'true' || github.event_name == 'schedule' }}
95-
run-with-macos: ${{ github.event.inputs.run-with-macos == 'true' }}
99+
run-with-macos: ${{ github.event.inputs.run-with-macos }}
96100

97101
test-go:
98102
name: Go Tests - ${{ matrix.go }}, EngineVersion - ${{ matrix.engine.version }}, Target - ${{ matrix.host.TARGET }}

.github/workflows/java.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ on:
4444
default: false
4545
run-with-macos:
4646
description: "Run with macos included (only when necessary)"
47-
type: boolean
47+
type: choice
48+
options:
49+
- false
50+
- on self hosted runners
51+
- on github runners
4852
default: false
4953
name:
5054
required: false
@@ -59,7 +63,7 @@ on:
5963
inputs:
6064
run-with-macos:
6165
description: "Run with macos included (only when necessary)"
62-
type: boolean
66+
type: string
6367
default: false
6468

6569
concurrency:
@@ -85,7 +89,7 @@ jobs:
8589
language-name: java
8690
# Run full test matrix if job started by cron or it was explictly specified by a person who triggered the workflow
8791
run-full-matrix: ${{ github.event.inputs.full-matrix == 'true' || github.event_name == 'schedule' }}
88-
run-with-macos: ${{ (github.event.inputs.run-with-macos == 'true') }}
92+
run-with-macos: ${{ (github.event.inputs.run-with-macos) }}
8993

9094
test-java:
9195
name: Java Tests - ${{ matrix.java }}, EngineVersion - ${{ matrix.engine.version }}, Target - ${{ matrix.host.TARGET }}

.github/workflows/node.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ on:
4242
default: false
4343
run-with-macos:
4444
description: "Run with macos included (only when necessary)"
45-
type: boolean
45+
type: choice
46+
options:
47+
- false
48+
- on self hosted runners
49+
- on github runners
4650
default: false
4751
name:
4852
required: false
@@ -57,7 +61,7 @@ on:
5761
inputs:
5862
run-with-macos:
5963
description: "Run with macos included (only when necessary)"
60-
type: boolean
64+
type: string
6165
default: false
6266

6367
concurrency:
@@ -86,7 +90,7 @@ jobs:
8690
with:
8791
language-name: node
8892
run-full-matrix: ${{ github.event.inputs.full-matrix == 'true' || github.event_name == 'schedule' }}
89-
run-with-macos: ${{ github.event.run-with-macos == 'true' }}
93+
run-with-macos: ${{ github.event.run-with-macos }}
9094

9195
test-node:
9296
name: Node Tests - ${{ matrix.node }}, EngineVersion - ${{ matrix.engine.version }}, Target - ${{ matrix.host.TARGET }}

.github/workflows/python.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ on:
4545
default: false
4646
run-with-macos:
4747
description: "Run with macos included (only when necessary)"
48-
type: boolean
48+
type: choice
49+
options:
50+
- false
51+
- on self hosted runners
52+
- on github runners
4953
default: false
5054
name:
5155
required: false
@@ -70,7 +74,7 @@ on:
7074
inputs:
7175
run-with-macos:
7276
description: "Run with macos included (only when necessary)"
73-
type: boolean
77+
type: string
7478
default: false
7579

7680
concurrency:
@@ -89,7 +93,7 @@ run-name:
8993
env:
9094
# Run full test matrix if job started by cron or it was explictly specified by a person who triggered the workflow
9195
RUN_FULL_MATRIX: ${{ (github.event.inputs.full-matrix == 'true' || github.event_name == 'schedule') }}
92-
RUN_WITH_MACOS: ${{ (github.event.inputs.run-with-macos == 'true') }}
96+
RUN_WITH_MACOS: ${{ (github.event.inputs.run-with-macos) }}
9397
RUN_SYNC_ONLY: ${{ (github.event.inputs.run_sync_tests == 'true' && github.event.inputs.run_async_tests == 'false') }}
9498
RUN_ASYNC_ONLY: ${{ (github.event.inputs.run_async_tests == 'true' && github.event.inputs.run_sync_tests == 'false') }}
9599

@@ -107,7 +111,7 @@ jobs:
107111
with:
108112
language-name: python
109113
run-full-matrix: ${{ env.RUN_FULL_MATRIX == 'true' }}
110-
run-with-macos: ${{ env.RUN_WITH_MACOS == 'true' }}
114+
run-with-macos: ${{ env.RUN_WITH_MACOS }}
111115

112116
test-python:
113117
name: Python Tests - ${{ matrix.python }}, EngineVersion - ${{ matrix.engine.version }}, Target - ${{ matrix.host.TARGET }}

.github/workflows/rust.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ on:
4444
default: false
4545
run-with-macos:
4646
description: "Run with macos included (only when necessary)"
47-
type: boolean
47+
type: choice
48+
options:
49+
- false
50+
- on self hosted runners
51+
- on github runners
4852
default: false
4953
name:
5054
required: false
@@ -55,7 +59,7 @@ on:
5559
inputs:
5660
run-with-macos:
5761
description: "Run with macos included (only when necessary)"
58-
type: boolean
62+
type: string
5963
default: false
6064

6165
concurrency:
@@ -87,7 +91,7 @@ jobs:
8791
language-name: rust
8892
# Run full test matrix if job started by cron or it was explictly specified by a person who triggered the workflow
8993
run-full-matrix: ${{ github.event.inputs.full-matrix == 'true' || github.event_name == 'schedule' }}
90-
run-with-macos: ${{ github.event.inputs.run-with-macos == 'true' }}
94+
run-with-macos: ${{ github.event.inputs.run-with-macos }}
9195

9296
tests:
9397
runs-on: ${{ matrix.host.RUNNER }}

0 commit comments

Comments
 (0)