Skip to content

Commit

Permalink
ci(alt): Add a new type of CI runner (dagger#9182)
Browse files Browse the repository at this point in the history
Signed-off-by: Gerhard Lazu <[email protected]>
  • Loading branch information
gerhard authored Dec 12, 2024
1 parent c4f683f commit 89b73c7
Show file tree
Hide file tree
Showing 5 changed files with 183 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/_dagger_on_depot_local_engine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ on:
size:
description: "Runner size"
type: number
required: true
default: 16
required: false
timeout:
description: "Timeout if not finished after this many minutes"
type: number
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/_dagger_on_namespace_local_engine.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Dagger on Namespace - Local Engine

on:
workflow_call:
inputs:
function:
description: "Dagger function"
type: string
required: true
size:
description: "Runner size"
type: number
default: 16
required: false
timeout:
description: "Timeout if not finished after this many minutes"
type: number
default: 10
required: false
dev:
description: "Use a development version of Dagger"
type: string
default: "false"
required: false
ubuntu:
description: "Ubuntu version"
type: string
default: "24.04"
required: false

jobs:
local-dagger-engine:
if: ${{ github.repository == 'dagger/dagger' }}
runs-on:
- nscloud-ubuntu-${{ inputs.ubuntu }}-amd64-${{ inputs.size }}x32
timeout-minutes: ${{ inputs.timeout }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: ${{ inputs.function }}
uses: ./.github/actions/call
with:
function: ${{ inputs.function }}
dev-engine: ${{ inputs.dev }}
- name: ${{ inputs.function }} (CACHE TEST)
uses: ./.github/actions/call
with:
function: ${{ inputs.function }}
dev-engine: ${{ inputs.dev }}
52 changes: 52 additions & 0 deletions .github/workflows/_dagger_on_namespace_remote_engine.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Dagger on Namespace - Remote Engine

on:
workflow_call:
inputs:
function:
description: "Dagger function"
type: string
required: true
size:
description: "Runner size - used by the Dagger Engine too"
type: number
default: 16
required: false
timeout:
description: "Timeout if not finished after this many minutes"
type: number
default: 10
required: false
dagger:
description: "Dagger version"
type: string
default: "0.15.0"
required: false
ubuntu:
description: "Ubuntu version"
type: string
default: "24.04"
required: false

jobs:
remote-dagger-engine:
if: ${{ github.repository == 'dagger/dagger' }}
runs-on:
- nscloud-ubuntu-${{ inputs.ubuntu }}-amd64-${{ inputs.size }}x32
- namespace-experiments:dagger.integration=enabled;dagger.version=${{ inputs.dagger }}
timeout-minutes: ${{ inputs.timeout }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: ${{ inputs.function }}
uses: ./.github/actions/call
with:
function: ${{ inputs.function }}
version: v${{ inputs.dagger }}
dev-engine: ${{ inputs.dev }}
- name: ${{ inputs.function }} (CACHE TEST)
uses: ./.github/actions/call
with:
function: ${{ inputs.function }}
version: v${{ inputs.dagger }}
dev-engine: ${{ inputs.dev }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Alternative CI Runners
name: Alternative CI Runners 1

on:
# Run the workflow every day TWICE:
Expand All @@ -17,6 +17,12 @@ jobs:
uses: ./.github/workflows/_dagger_on_depot_remote_engine.yml
with:
function: docs lint
docs-lint-on-depot-local-engine:
uses: ./.github/workflows/_dagger_on_depot_local_engine.yml
with:
function: docs lint
dev: true
timeout: 20

test-cli-engine-on-depot-remote-engine:
needs: docs-lint-on-depot-remote-engine
Expand All @@ -31,22 +37,23 @@ jobs:
with:
function: check --targets=sdk/go
sdk-go-dev-on-depot-local-engine:
needs: sdk-go-on-depot-remote-engine
uses: ./.github/workflows/_dagger_on_depot_local_engine.yml
with:
function: check --targets=sdk/go
size: 4
dev: true
timeout: 15

sdk-python-on-depot-remote-engine:
needs: docs-lint-on-depot-remote-engine
uses: ./.github/workflows/_dagger_on_depot_remote_engine.yml
with:
function: check --targets=sdk/python
sdk-python-dev-on-depot-local-engine:
needs: sdk-python-on-depot-remote-engine
uses: ./.github/workflows/_dagger_on_depot_local_engine.yml
with:
function: check --targets=sdk/python
size: 8
dev: true

sdk-typescript-on-depot-remote-engine:
Expand All @@ -55,8 +62,8 @@ jobs:
with:
function: check --targets=sdk/typescript
sdk-typescript-dev-on-depot-local-engine:
needs: sdk-typescript-on-depot-remote-engine
uses: ./.github/workflows/_dagger_on_depot_local_engine.yml
with:
function: check --targets=sdk/typescript
size: 8
dev: true
69 changes: 69 additions & 0 deletions .github/workflows/alternative-ci-runners-2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Alternative CI Runners 2

on:
# Run the workflow every day TWICE:
# 1. 9:06AM UTC (low activity)
# 2. 9:26AM UTC (cache test - high chance of no code changes)
schedule:
- cron: "6,26 9 * * *"
# Enable manual trigger for on-demand runs - helps when debugging
workflow_dispatch:

permissions:
contents: read

jobs:
docs-lint-on-namespace-remote-engine:
uses: ./.github/workflows/_dagger_on_namespace_remote_engine.yml
with:
function: docs lint
timeout: 20
docs-lint-on-namespace-local-engine:
uses: ./.github/workflows/_dagger_on_namespace_local_engine.yml
with:
function: docs lint
dev: true
timeout: 20

test-cli-engine-on-namespace-remote-engine:
needs: docs-lint-on-namespace-remote-engine
uses: ./.github/workflows/_dagger_on_namespace_remote_engine.yml
with:
function: test specific --run='TestCLI|TestEngine' --race=true --parallel=16
timeout: 20

sdk-go-on-namespace-remote-engine:
needs: docs-lint-on-namespace-remote-engine
uses: ./.github/workflows/_dagger_on_namespace_remote_engine.yml
with:
function: check --targets=sdk/go
sdk-go-dev-on-namespace-local-engine:
needs: sdk-go-on-namespace-remote-engine
uses: ./.github/workflows/_dagger_on_namespace_local_engine.yml
with:
function: check --targets=sdk/go
dev: true

sdk-python-on-namespace-remote-engine:
needs: docs-lint-on-namespace-remote-engine
uses: ./.github/workflows/_dagger_on_namespace_remote_engine.yml
with:
function: check --targets=sdk/python
sdk-python-dev-on-namespace-local-engine:
needs: sdk-python-on-namespace-remote-engine
uses: ./.github/workflows/_dagger_on_namespace_local_engine.yml
with:
function: check --targets=sdk/python
dev: true

sdk-typescript-on-namespace-remote-engine:
needs: docs-lint-on-namespace-remote-engine
uses: ./.github/workflows/_dagger_on_namespace_remote_engine.yml
with:
function: check --targets=sdk/typescript
sdk-typescript-dev-on-namespace-local-engine:
needs: sdk-typescript-on-namespace-remote-engine
uses: ./.github/workflows/_dagger_on_namespace_local_engine.yml
with:
function: check --targets=sdk/typescript
dev: true

0 comments on commit 89b73c7

Please sign in to comment.