Skip to content

docs: Update docs for cloud v3 (#9450) #3

docs: Update docs for cloud v3 (#9450)

docs: Update docs for cloud v3 (#9450) #3

# This file was generated. See https://daggerverse.dev/mod/github.com/dagger/dagger/modules/gha
name: Engine & CLI
"on":
push:
branches:
- main
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
workflow_dispatch: {}
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
cli-test-publish:
runs-on:
- ${{ github.repository == 'dagger/dagger' && 'dagger-g3-v0-15-3-4c' || 'ubuntu-latest' }}
name: cli-test-publish
steps:
- name: Checkout
uses: actions/checkout@v4
- name: scripts/install-dagger.sh
id: install-dagger
run: |
#!/bin/bash
set -o pipefail
# Fallback to /usr/local for backwards compatability
prefix_dir="${RUNNER_TEMP:-/usr/local}"
# Ensure the dir is writable otherwise fallback to tmpdir
if [[ ! -d "$prefix_dir" ]] || [[ ! -w "$prefix_dir" ]]; then
prefix_dir="$(mktemp -d)"
fi
printf '%s/bin' "$prefix_dir" >> $GITHUB_PATH
# If the dagger version is 'latest', set the version back to an empty
# string. This allows the install script to detect and install the latest
# version itself
if [[ "$DAGGER_VERSION" == "latest" ]]; then
DAGGER_VERSION=
fi
# The install.sh script creates path ${prefix_dir}/bin
curl -fsS https://dl.dagger.io/dagger/install.sh | BIN_DIR=${prefix_dir}/bin sh
env:
DAGGER_VERSION: v0.15.3
shell: bash
- name: scripts/warm-engine.sh
id: warm-engine
run: |
#!/bin/bash
# Make sure not to load any implicit module
cd $(mktemp -d)
# Run a simple query to "warm up" the engine
echo '{directory{id}}' | dagger query
shell: bash
- name: scripts/exec.sh
id: exec
run: |
#!/bin/bash --noprofile --norc -e -o pipefail
if [[ -n "$DEBUG" && "$DEBUG" != "0" ]]; then
set -x
env
which dagger
pwd
ls -l
ps aux
fi
# Detect if a dev engine is available, if so: use that
# We don't rely on PATH because the GHA runner messes with that
if [[ -n "$_EXPERIMENTAL_DAGGER_CLI_BIN" ]]; then
export PATH=$(dirname "$_EXPERIMENTAL_DAGGER_CLI_BIN"):$PATH
fi
GITHUB_STEP_SUMMARY="${GITHUB_STEP_SUMMARY:=github-summary.md}"
export NO_COLOR="${NO_COLOR:=1}" # Disable colors in dagger logs
# Ensure the command is provided as an environment variable
if [ -z "$COMMAND" ]; then
echo "Error: Please set the COMMAND environment variable."
exit 1
fi
tmp=$(mktemp -d)
(
cd $tmp
# Create named pipes (FIFOs) for stdout and stderr
mkfifo stdout.fifo stderr.fifo
# Set up tee to capture and display stdout and stderr
if [ -n "$NO_OUTPUT" ]; then
tee stdout.txt < stdout.fifo > /dev/null &
tee stderr.txt < stderr.fifo > /dev/null &
else
tee stdout.txt < stdout.fifo &
tee stderr.txt < stderr.fifo >&2 &
fi
)
# Run the command, capturing stdout and stderr in the FIFOs
set +e
eval "$COMMAND" > $tmp/stdout.fifo 2> $tmp/stderr.fifo
EXIT_CODE=$?
set -e
# Wait for all background jobs to finish
wait
# Extra trace URL
TRACE_URL=$(sed -En 's/^Full trace at (.*)/\1/p' < $tmp/stderr.txt)
{
cat <<'.'
## Dagger trace
.
if [[ "$TRACE_URL" == *"rotate dagger.cloud token for full url"* ]]; then
cat <<.
Cloud token must be rotated. Please follow these steps:
1. Go to [Dagger Cloud](https://dagger.cloud)
2. Click on your profile icon in the bottom left corner
3. Click on "Organization Settings"
4. Click on "Regenerate token"
5. Update the [\`DAGGER_CLOUD_TOKEN\` secret in your GitHub repository settings](https://github.com/${GITHUB_REPOSITORY:?Error: GITHUB_REPOSITORY is not set}/settings/secrets/actions/DAGGER_CLOUD_TOKEN)
.
elif [ -n "$TRACE_URL" ]; then
echo "[$TRACE_URL]($TRACE_URL)"
else
echo "No trace available. To setup: [https://dagger.cloud/traces/setup](https://dagger.cloud/traces/setup)"
fi
cat <<'.'
## Dagger version
```
.
dagger version
cat <<'.'
```
## Pipeline command
```bash
.
echo "DAGGER_MODULE=$DAGGER_MODULE \\"
echo " $COMMAND"
cat <<'.'
```
## Pipeline output
```
.
cat $tmp/stdout.txt
cat <<'.'
```
## Pipeline logs
```
.
tail -n 1000 $tmp/stderr.txt
cat <<'.'
```
.
} >"${GITHUB_STEP_SUMMARY}"
echo "stdout_file=$tmp/stdout.txt" >>"$GITHUB_OUTPUT"
echo "stderr_file=$tmp/stderr.txt" >>"$GITHUB_OUTPUT"
exit $EXIT_CODE
env:
_EXPERIMENTAL_DAGGER_CLOUD_TOKEN: dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw
COMMAND: dagger call -q cli test-publish
DAGGER_CLOUD_TOKEN: dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw
shell: bash
timeout-minutes: 10
engine-lint:
runs-on:
- ${{ github.repository == 'dagger/dagger' && 'dagger-g3-v0-15-3-16c-st' || 'ubuntu-latest' }}
name: engine-lint
steps:
- name: Checkout
uses: actions/checkout@v4
- name: scripts/install-dagger.sh
id: install-dagger
run: |
#!/bin/bash
set -o pipefail
# Fallback to /usr/local for backwards compatability
prefix_dir="${RUNNER_TEMP:-/usr/local}"
# Ensure the dir is writable otherwise fallback to tmpdir
if [[ ! -d "$prefix_dir" ]] || [[ ! -w "$prefix_dir" ]]; then
prefix_dir="$(mktemp -d)"
fi
printf '%s/bin' "$prefix_dir" >> $GITHUB_PATH
# If the dagger version is 'latest', set the version back to an empty
# string. This allows the install script to detect and install the latest
# version itself
if [[ "$DAGGER_VERSION" == "latest" ]]; then
DAGGER_VERSION=
fi
# The install.sh script creates path ${prefix_dir}/bin
curl -fsS https://dl.dagger.io/dagger/install.sh | BIN_DIR=${prefix_dir}/bin sh
env:
DAGGER_VERSION: v0.15.3
shell: bash
- name: scripts/warm-engine.sh
id: warm-engine
run: |
#!/bin/bash
# Make sure not to load any implicit module
cd $(mktemp -d)
# Run a simple query to "warm up" the engine
echo '{directory{id}}' | dagger query
shell: bash
- name: scripts/exec.sh
id: exec
run: |
#!/bin/bash --noprofile --norc -e -o pipefail
if [[ -n "$DEBUG" && "$DEBUG" != "0" ]]; then
set -x
env
which dagger
pwd
ls -l
ps aux
fi
# Detect if a dev engine is available, if so: use that
# We don't rely on PATH because the GHA runner messes with that
if [[ -n "$_EXPERIMENTAL_DAGGER_CLI_BIN" ]]; then
export PATH=$(dirname "$_EXPERIMENTAL_DAGGER_CLI_BIN"):$PATH
fi
GITHUB_STEP_SUMMARY="${GITHUB_STEP_SUMMARY:=github-summary.md}"
export NO_COLOR="${NO_COLOR:=1}" # Disable colors in dagger logs
# Ensure the command is provided as an environment variable
if [ -z "$COMMAND" ]; then
echo "Error: Please set the COMMAND environment variable."
exit 1
fi
tmp=$(mktemp -d)
(
cd $tmp
# Create named pipes (FIFOs) for stdout and stderr
mkfifo stdout.fifo stderr.fifo
# Set up tee to capture and display stdout and stderr
if [ -n "$NO_OUTPUT" ]; then
tee stdout.txt < stdout.fifo > /dev/null &
tee stderr.txt < stderr.fifo > /dev/null &
else
tee stdout.txt < stdout.fifo &
tee stderr.txt < stderr.fifo >&2 &
fi
)
# Run the command, capturing stdout and stderr in the FIFOs
set +e
eval "$COMMAND" > $tmp/stdout.fifo 2> $tmp/stderr.fifo
EXIT_CODE=$?
set -e
# Wait for all background jobs to finish
wait
# Extra trace URL
TRACE_URL=$(sed -En 's/^Full trace at (.*)/\1/p' < $tmp/stderr.txt)
{
cat <<'.'
## Dagger trace
.
if [[ "$TRACE_URL" == *"rotate dagger.cloud token for full url"* ]]; then
cat <<.
Cloud token must be rotated. Please follow these steps:
1. Go to [Dagger Cloud](https://dagger.cloud)
2. Click on your profile icon in the bottom left corner
3. Click on "Organization Settings"
4. Click on "Regenerate token"
5. Update the [\`DAGGER_CLOUD_TOKEN\` secret in your GitHub repository settings](https://github.com/${GITHUB_REPOSITORY:?Error: GITHUB_REPOSITORY is not set}/settings/secrets/actions/DAGGER_CLOUD_TOKEN)
.
elif [ -n "$TRACE_URL" ]; then
echo "[$TRACE_URL]($TRACE_URL)"
else
echo "No trace available. To setup: [https://dagger.cloud/traces/setup](https://dagger.cloud/traces/setup)"
fi
cat <<'.'
## Dagger version
```
.
dagger version
cat <<'.'
```
## Pipeline command
```bash
.
echo "DAGGER_MODULE=$DAGGER_MODULE \\"
echo " $COMMAND"
cat <<'.'
```
## Pipeline output
```
.
cat $tmp/stdout.txt
cat <<'.'
```
## Pipeline logs
```
.
tail -n 1000 $tmp/stderr.txt
cat <<'.'
```
.
} >"${GITHUB_STEP_SUMMARY}"
echo "stdout_file=$tmp/stdout.txt" >>"$GITHUB_OUTPUT"
echo "stderr_file=$tmp/stderr.txt" >>"$GITHUB_OUTPUT"
exit $EXIT_CODE
env:
_EXPERIMENTAL_DAGGER_CLOUD_TOKEN: dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw
COMMAND: dagger call -q engine lint
DAGGER_CLOUD_TOKEN: dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw
shell: bash
timeout-minutes: 10
engine-test-publish:
runs-on:
- ${{ github.repository == 'dagger/dagger' && 'dagger-g3-v0-15-3-4c' || 'ubuntu-latest' }}
name: engine-test-publish
steps:
- name: Checkout
uses: actions/checkout@v4
- name: scripts/install-dagger.sh
id: install-dagger
run: |
#!/bin/bash
set -o pipefail
# Fallback to /usr/local for backwards compatability
prefix_dir="${RUNNER_TEMP:-/usr/local}"
# Ensure the dir is writable otherwise fallback to tmpdir
if [[ ! -d "$prefix_dir" ]] || [[ ! -w "$prefix_dir" ]]; then
prefix_dir="$(mktemp -d)"
fi
printf '%s/bin' "$prefix_dir" >> $GITHUB_PATH
# If the dagger version is 'latest', set the version back to an empty
# string. This allows the install script to detect and install the latest
# version itself
if [[ "$DAGGER_VERSION" == "latest" ]]; then
DAGGER_VERSION=
fi
# The install.sh script creates path ${prefix_dir}/bin
curl -fsS https://dl.dagger.io/dagger/install.sh | BIN_DIR=${prefix_dir}/bin sh
env:
DAGGER_VERSION: v0.15.3
shell: bash
- name: scripts/warm-engine.sh
id: warm-engine
run: |
#!/bin/bash
# Make sure not to load any implicit module
cd $(mktemp -d)
# Run a simple query to "warm up" the engine
echo '{directory{id}}' | dagger query
shell: bash
- name: scripts/exec.sh
id: exec
run: |
#!/bin/bash --noprofile --norc -e -o pipefail
if [[ -n "$DEBUG" && "$DEBUG" != "0" ]]; then
set -x
env
which dagger
pwd
ls -l
ps aux
fi
# Detect if a dev engine is available, if so: use that
# We don't rely on PATH because the GHA runner messes with that
if [[ -n "$_EXPERIMENTAL_DAGGER_CLI_BIN" ]]; then
export PATH=$(dirname "$_EXPERIMENTAL_DAGGER_CLI_BIN"):$PATH
fi
GITHUB_STEP_SUMMARY="${GITHUB_STEP_SUMMARY:=github-summary.md}"
export NO_COLOR="${NO_COLOR:=1}" # Disable colors in dagger logs
# Ensure the command is provided as an environment variable
if [ -z "$COMMAND" ]; then
echo "Error: Please set the COMMAND environment variable."
exit 1
fi
tmp=$(mktemp -d)
(
cd $tmp
# Create named pipes (FIFOs) for stdout and stderr
mkfifo stdout.fifo stderr.fifo
# Set up tee to capture and display stdout and stderr
if [ -n "$NO_OUTPUT" ]; then
tee stdout.txt < stdout.fifo > /dev/null &
tee stderr.txt < stderr.fifo > /dev/null &
else
tee stdout.txt < stdout.fifo &
tee stderr.txt < stderr.fifo >&2 &
fi
)
# Run the command, capturing stdout and stderr in the FIFOs
set +e
eval "$COMMAND" > $tmp/stdout.fifo 2> $tmp/stderr.fifo
EXIT_CODE=$?
set -e
# Wait for all background jobs to finish
wait
# Extra trace URL
TRACE_URL=$(sed -En 's/^Full trace at (.*)/\1/p' < $tmp/stderr.txt)
{
cat <<'.'
## Dagger trace
.
if [[ "$TRACE_URL" == *"rotate dagger.cloud token for full url"* ]]; then
cat <<.
Cloud token must be rotated. Please follow these steps:
1. Go to [Dagger Cloud](https://dagger.cloud)
2. Click on your profile icon in the bottom left corner
3. Click on "Organization Settings"
4. Click on "Regenerate token"
5. Update the [\`DAGGER_CLOUD_TOKEN\` secret in your GitHub repository settings](https://github.com/${GITHUB_REPOSITORY:?Error: GITHUB_REPOSITORY is not set}/settings/secrets/actions/DAGGER_CLOUD_TOKEN)
.
elif [ -n "$TRACE_URL" ]; then
echo "[$TRACE_URL]($TRACE_URL)"
else
echo "No trace available. To setup: [https://dagger.cloud/traces/setup](https://dagger.cloud/traces/setup)"
fi
cat <<'.'
## Dagger version
```
.
dagger version
cat <<'.'
```
## Pipeline command
```bash
.
echo "DAGGER_MODULE=$DAGGER_MODULE \\"
echo " $COMMAND"
cat <<'.'
```
## Pipeline output
```
.
cat $tmp/stdout.txt
cat <<'.'
```
## Pipeline logs
```
.
tail -n 1000 $tmp/stderr.txt
cat <<'.'
```
.
} >"${GITHUB_STEP_SUMMARY}"
echo "stdout_file=$tmp/stdout.txt" >>"$GITHUB_OUTPUT"
echo "stderr_file=$tmp/stderr.txt" >>"$GITHUB_OUTPUT"
exit $EXIT_CODE
env:
_EXPERIMENTAL_DAGGER_CLOUD_TOKEN: dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw
COMMAND: dagger call -q engine publish --image=dagger-engine.dev --tag=main --dry-run
DAGGER_CLOUD_TOKEN: dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw
shell: bash
timeout-minutes: 10
scan-engine:
runs-on:
- ${{ github.repository == 'dagger/dagger' && 'dagger-g3-v0-15-3-4c' || 'ubuntu-latest' }}
name: scan-engine
steps:
- name: Checkout
uses: actions/checkout@v4
- name: scripts/install-dagger.sh
id: install-dagger
run: |
#!/bin/bash
set -o pipefail
# Fallback to /usr/local for backwards compatability
prefix_dir="${RUNNER_TEMP:-/usr/local}"
# Ensure the dir is writable otherwise fallback to tmpdir
if [[ ! -d "$prefix_dir" ]] || [[ ! -w "$prefix_dir" ]]; then
prefix_dir="$(mktemp -d)"
fi
printf '%s/bin' "$prefix_dir" >> $GITHUB_PATH
# If the dagger version is 'latest', set the version back to an empty
# string. This allows the install script to detect and install the latest
# version itself
if [[ "$DAGGER_VERSION" == "latest" ]]; then
DAGGER_VERSION=
fi
# The install.sh script creates path ${prefix_dir}/bin
curl -fsS https://dl.dagger.io/dagger/install.sh | BIN_DIR=${prefix_dir}/bin sh
env:
DAGGER_VERSION: v0.15.3
shell: bash
- name: scripts/warm-engine.sh
id: warm-engine
run: |
#!/bin/bash
# Make sure not to load any implicit module
cd $(mktemp -d)
# Run a simple query to "warm up" the engine
echo '{directory{id}}' | dagger query
shell: bash
- name: scripts/exec.sh
id: exec
run: |
#!/bin/bash --noprofile --norc -e -o pipefail
if [[ -n "$DEBUG" && "$DEBUG" != "0" ]]; then
set -x
env
which dagger
pwd
ls -l
ps aux
fi
# Detect if a dev engine is available, if so: use that
# We don't rely on PATH because the GHA runner messes with that
if [[ -n "$_EXPERIMENTAL_DAGGER_CLI_BIN" ]]; then
export PATH=$(dirname "$_EXPERIMENTAL_DAGGER_CLI_BIN"):$PATH
fi
GITHUB_STEP_SUMMARY="${GITHUB_STEP_SUMMARY:=github-summary.md}"
export NO_COLOR="${NO_COLOR:=1}" # Disable colors in dagger logs
# Ensure the command is provided as an environment variable
if [ -z "$COMMAND" ]; then
echo "Error: Please set the COMMAND environment variable."
exit 1
fi
tmp=$(mktemp -d)
(
cd $tmp
# Create named pipes (FIFOs) for stdout and stderr
mkfifo stdout.fifo stderr.fifo
# Set up tee to capture and display stdout and stderr
if [ -n "$NO_OUTPUT" ]; then
tee stdout.txt < stdout.fifo > /dev/null &
tee stderr.txt < stderr.fifo > /dev/null &
else
tee stdout.txt < stdout.fifo &
tee stderr.txt < stderr.fifo >&2 &
fi
)
# Run the command, capturing stdout and stderr in the FIFOs
set +e
eval "$COMMAND" > $tmp/stdout.fifo 2> $tmp/stderr.fifo
EXIT_CODE=$?
set -e
# Wait for all background jobs to finish
wait
# Extra trace URL
TRACE_URL=$(sed -En 's/^Full trace at (.*)/\1/p' < $tmp/stderr.txt)
{
cat <<'.'
## Dagger trace
.
if [[ "$TRACE_URL" == *"rotate dagger.cloud token for full url"* ]]; then
cat <<.
Cloud token must be rotated. Please follow these steps:
1. Go to [Dagger Cloud](https://dagger.cloud)
2. Click on your profile icon in the bottom left corner
3. Click on "Organization Settings"
4. Click on "Regenerate token"
5. Update the [\`DAGGER_CLOUD_TOKEN\` secret in your GitHub repository settings](https://github.com/${GITHUB_REPOSITORY:?Error: GITHUB_REPOSITORY is not set}/settings/secrets/actions/DAGGER_CLOUD_TOKEN)
.
elif [ -n "$TRACE_URL" ]; then
echo "[$TRACE_URL]($TRACE_URL)"
else
echo "No trace available. To setup: [https://dagger.cloud/traces/setup](https://dagger.cloud/traces/setup)"
fi
cat <<'.'
## Dagger version
```
.
dagger version
cat <<'.'
```
## Pipeline command
```bash
.
echo "DAGGER_MODULE=$DAGGER_MODULE \\"
echo " $COMMAND"
cat <<'.'
```
## Pipeline output
```
.
cat $tmp/stdout.txt
cat <<'.'
```
## Pipeline logs
```
.
tail -n 1000 $tmp/stderr.txt
cat <<'.'
```
.
} >"${GITHUB_STEP_SUMMARY}"
echo "stdout_file=$tmp/stdout.txt" >>"$GITHUB_OUTPUT"
echo "stderr_file=$tmp/stderr.txt" >>"$GITHUB_OUTPUT"
exit $EXIT_CODE
env:
_EXPERIMENTAL_DAGGER_CLOUD_TOKEN: dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw
COMMAND: dagger call -q engine scan
DAGGER_CLOUD_TOKEN: dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw
shell: bash
timeout-minutes: 10
scripts-lint:
runs-on:
- ${{ github.repository == 'dagger/dagger' && 'dagger-g3-v0-15-3-4c' || 'ubuntu-latest' }}
name: scripts-lint
steps:
- name: Checkout
uses: actions/checkout@v4
- name: scripts/install-dagger.sh
id: install-dagger
run: |
#!/bin/bash
set -o pipefail
# Fallback to /usr/local for backwards compatability
prefix_dir="${RUNNER_TEMP:-/usr/local}"
# Ensure the dir is writable otherwise fallback to tmpdir
if [[ ! -d "$prefix_dir" ]] || [[ ! -w "$prefix_dir" ]]; then
prefix_dir="$(mktemp -d)"
fi
printf '%s/bin' "$prefix_dir" >> $GITHUB_PATH
# If the dagger version is 'latest', set the version back to an empty
# string. This allows the install script to detect and install the latest
# version itself
if [[ "$DAGGER_VERSION" == "latest" ]]; then
DAGGER_VERSION=
fi
# The install.sh script creates path ${prefix_dir}/bin
curl -fsS https://dl.dagger.io/dagger/install.sh | BIN_DIR=${prefix_dir}/bin sh
env:
DAGGER_VERSION: v0.15.3
shell: bash
- name: scripts/warm-engine.sh
id: warm-engine
run: |
#!/bin/bash
# Make sure not to load any implicit module
cd $(mktemp -d)
# Run a simple query to "warm up" the engine
echo '{directory{id}}' | dagger query
shell: bash
- name: scripts/exec.sh
id: exec
run: |
#!/bin/bash --noprofile --norc -e -o pipefail
if [[ -n "$DEBUG" && "$DEBUG" != "0" ]]; then
set -x
env
which dagger
pwd
ls -l
ps aux
fi
# Detect if a dev engine is available, if so: use that
# We don't rely on PATH because the GHA runner messes with that
if [[ -n "$_EXPERIMENTAL_DAGGER_CLI_BIN" ]]; then
export PATH=$(dirname "$_EXPERIMENTAL_DAGGER_CLI_BIN"):$PATH
fi
GITHUB_STEP_SUMMARY="${GITHUB_STEP_SUMMARY:=github-summary.md}"
export NO_COLOR="${NO_COLOR:=1}" # Disable colors in dagger logs
# Ensure the command is provided as an environment variable
if [ -z "$COMMAND" ]; then
echo "Error: Please set the COMMAND environment variable."
exit 1
fi
tmp=$(mktemp -d)
(
cd $tmp
# Create named pipes (FIFOs) for stdout and stderr
mkfifo stdout.fifo stderr.fifo
# Set up tee to capture and display stdout and stderr
if [ -n "$NO_OUTPUT" ]; then
tee stdout.txt < stdout.fifo > /dev/null &
tee stderr.txt < stderr.fifo > /dev/null &
else
tee stdout.txt < stdout.fifo &
tee stderr.txt < stderr.fifo >&2 &
fi
)
# Run the command, capturing stdout and stderr in the FIFOs
set +e
eval "$COMMAND" > $tmp/stdout.fifo 2> $tmp/stderr.fifo
EXIT_CODE=$?
set -e
# Wait for all background jobs to finish
wait
# Extra trace URL
TRACE_URL=$(sed -En 's/^Full trace at (.*)/\1/p' < $tmp/stderr.txt)
{
cat <<'.'
## Dagger trace
.
if [[ "$TRACE_URL" == *"rotate dagger.cloud token for full url"* ]]; then
cat <<.
Cloud token must be rotated. Please follow these steps:
1. Go to [Dagger Cloud](https://dagger.cloud)
2. Click on your profile icon in the bottom left corner
3. Click on "Organization Settings"
4. Click on "Regenerate token"
5. Update the [\`DAGGER_CLOUD_TOKEN\` secret in your GitHub repository settings](https://github.com/${GITHUB_REPOSITORY:?Error: GITHUB_REPOSITORY is not set}/settings/secrets/actions/DAGGER_CLOUD_TOKEN)
.
elif [ -n "$TRACE_URL" ]; then
echo "[$TRACE_URL]($TRACE_URL)"
else
echo "No trace available. To setup: [https://dagger.cloud/traces/setup](https://dagger.cloud/traces/setup)"
fi
cat <<'.'
## Dagger version
```
.
dagger version
cat <<'.'
```
## Pipeline command
```bash
.
echo "DAGGER_MODULE=$DAGGER_MODULE \\"
echo " $COMMAND"
cat <<'.'
```
## Pipeline output
```
.
cat $tmp/stdout.txt
cat <<'.'
```
## Pipeline logs
```
.
tail -n 1000 $tmp/stderr.txt
cat <<'.'
```
.
} >"${GITHUB_STEP_SUMMARY}"
echo "stdout_file=$tmp/stdout.txt" >>"$GITHUB_OUTPUT"
echo "stderr_file=$tmp/stderr.txt" >>"$GITHUB_OUTPUT"
exit $EXIT_CODE
env:
_EXPERIMENTAL_DAGGER_CLOUD_TOKEN: dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw
COMMAND: dagger call -q scripts lint
DAGGER_CLOUD_TOKEN: dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw
shell: bash
timeout-minutes: 10
test-cgroupsv-2:
runs-on:
- ubuntu-latest
name: test-cgroupsv2
steps:
- name: Checkout
uses: actions/checkout@v4
- name: scripts/install-dagger.sh
id: install-dagger
run: |
#!/bin/bash
set -o pipefail
# Fallback to /usr/local for backwards compatability
prefix_dir="${RUNNER_TEMP:-/usr/local}"
# Ensure the dir is writable otherwise fallback to tmpdir
if [[ ! -d "$prefix_dir" ]] || [[ ! -w "$prefix_dir" ]]; then
prefix_dir="$(mktemp -d)"
fi
printf '%s/bin' "$prefix_dir" >> $GITHUB_PATH
# If the dagger version is 'latest', set the version back to an empty
# string. This allows the install script to detect and install the latest
# version itself
if [[ "$DAGGER_VERSION" == "latest" ]]; then
DAGGER_VERSION=
fi
# The install.sh script creates path ${prefix_dir}/bin
curl -fsS https://dl.dagger.io/dagger/install.sh | BIN_DIR=${prefix_dir}/bin sh
env:
DAGGER_VERSION: v0.15.3
shell: bash
- name: scripts/warm-engine.sh
id: warm-engine
run: |
#!/bin/bash
# Make sure not to load any implicit module
cd $(mktemp -d)
# Run a simple query to "warm up" the engine
echo '{directory{id}}' | dagger query
shell: bash
- name: sudo sysctl -w vm.overcommit_memory=1
run: sudo sysctl -w vm.overcommit_memory=1
shell: bash
- name: scripts/exec.sh
id: exec
run: |
#!/bin/bash --noprofile --norc -e -o pipefail
if [[ -n "$DEBUG" && "$DEBUG" != "0" ]]; then
set -x
env
which dagger
pwd
ls -l
ps aux
fi
# Detect if a dev engine is available, if so: use that
# We don't rely on PATH because the GHA runner messes with that
if [[ -n "$_EXPERIMENTAL_DAGGER_CLI_BIN" ]]; then
export PATH=$(dirname "$_EXPERIMENTAL_DAGGER_CLI_BIN"):$PATH
fi
GITHUB_STEP_SUMMARY="${GITHUB_STEP_SUMMARY:=github-summary.md}"
export NO_COLOR="${NO_COLOR:=1}" # Disable colors in dagger logs
# Ensure the command is provided as an environment variable
if [ -z "$COMMAND" ]; then
echo "Error: Please set the COMMAND environment variable."
exit 1
fi
tmp=$(mktemp -d)
(
cd $tmp
# Create named pipes (FIFOs) for stdout and stderr
mkfifo stdout.fifo stderr.fifo
# Set up tee to capture and display stdout and stderr
if [ -n "$NO_OUTPUT" ]; then
tee stdout.txt < stdout.fifo > /dev/null &
tee stderr.txt < stderr.fifo > /dev/null &
else
tee stdout.txt < stdout.fifo &
tee stderr.txt < stderr.fifo >&2 &
fi
)
# Run the command, capturing stdout and stderr in the FIFOs
set +e
eval "$COMMAND" > $tmp/stdout.fifo 2> $tmp/stderr.fifo
EXIT_CODE=$?
set -e
# Wait for all background jobs to finish
wait
# Extra trace URL
TRACE_URL=$(sed -En 's/^Full trace at (.*)/\1/p' < $tmp/stderr.txt)
{
cat <<'.'
## Dagger trace
.
if [[ "$TRACE_URL" == *"rotate dagger.cloud token for full url"* ]]; then
cat <<.
Cloud token must be rotated. Please follow these steps:
1. Go to [Dagger Cloud](https://dagger.cloud)
2. Click on your profile icon in the bottom left corner
3. Click on "Organization Settings"
4. Click on "Regenerate token"
5. Update the [\`DAGGER_CLOUD_TOKEN\` secret in your GitHub repository settings](https://github.com/${GITHUB_REPOSITORY:?Error: GITHUB_REPOSITORY is not set}/settings/secrets/actions/DAGGER_CLOUD_TOKEN)
.
elif [ -n "$TRACE_URL" ]; then
echo "[$TRACE_URL]($TRACE_URL)"
else
echo "No trace available. To setup: [https://dagger.cloud/traces/setup](https://dagger.cloud/traces/setup)"
fi
cat <<'.'
## Dagger version
```
.
dagger version
cat <<'.'
```
## Pipeline command
```bash
.
echo "DAGGER_MODULE=$DAGGER_MODULE \\"
echo " $COMMAND"
cat <<'.'
```
## Pipeline output
```
.
cat $tmp/stdout.txt
cat <<'.'
```
## Pipeline logs
```
.
tail -n 1000 $tmp/stderr.txt
cat <<'.'
```
.
} >"${GITHUB_STEP_SUMMARY}"
echo "stdout_file=$tmp/stdout.txt" >>"$GITHUB_OUTPUT"
echo "stderr_file=$tmp/stderr.txt" >>"$GITHUB_OUTPUT"
exit $EXIT_CODE
env:
_EXPERIMENTAL_DAGGER_CLOUD_TOKEN: dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw
COMMAND: dagger call -q test specific --race=true --parallel=16 --run='TestProvision|TestTelemetry'
DAGGER_CLOUD_TOKEN: dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw
NO_OUTPUT: "true"
shell: bash
- name: Upload call logs
uses: actions/upload-artifact@v4
with:
name: call-logs-${{ runner.name }}-${{ github.job }}exec
overwrite: "true"
path: ${{ steps.exec.outputs.stderr_file }}
if: always()
timeout-minutes: 30
test-cli-engine:
runs-on:
- ${{ github.repository == 'dagger/dagger' && 'dagger-g3-v0-15-3-16c-st' || 'ubuntu-latest' }}
name: test-cli-engine
steps:
- name: Checkout
uses: actions/checkout@v4
- name: scripts/install-dagger.sh
id: install-dagger
run: |
#!/bin/bash
set -o pipefail
# Fallback to /usr/local for backwards compatability
prefix_dir="${RUNNER_TEMP:-/usr/local}"
# Ensure the dir is writable otherwise fallback to tmpdir
if [[ ! -d "$prefix_dir" ]] || [[ ! -w "$prefix_dir" ]]; then
prefix_dir="$(mktemp -d)"
fi
printf '%s/bin' "$prefix_dir" >> $GITHUB_PATH
# If the dagger version is 'latest', set the version back to an empty
# string. This allows the install script to detect and install the latest
# version itself
if [[ "$DAGGER_VERSION" == "latest" ]]; then
DAGGER_VERSION=
fi
# The install.sh script creates path ${prefix_dir}/bin
curl -fsS https://dl.dagger.io/dagger/install.sh | BIN_DIR=${prefix_dir}/bin sh
env:
DAGGER_VERSION: v0.15.3
shell: bash
- name: scripts/warm-engine.sh
id: warm-engine
run: |
#!/bin/bash
# Make sure not to load any implicit module
cd $(mktemp -d)
# Run a simple query to "warm up" the engine
echo '{directory{id}}' | dagger query
shell: bash
- name: scripts/exec.sh
id: exec
run: |
#!/bin/bash --noprofile --norc -e -o pipefail
if [[ -n "$DEBUG" && "$DEBUG" != "0" ]]; then
set -x
env
which dagger
pwd
ls -l
ps aux
fi
# Detect if a dev engine is available, if so: use that
# We don't rely on PATH because the GHA runner messes with that
if [[ -n "$_EXPERIMENTAL_DAGGER_CLI_BIN" ]]; then
export PATH=$(dirname "$_EXPERIMENTAL_DAGGER_CLI_BIN"):$PATH
fi
GITHUB_STEP_SUMMARY="${GITHUB_STEP_SUMMARY:=github-summary.md}"
export NO_COLOR="${NO_COLOR:=1}" # Disable colors in dagger logs
# Ensure the command is provided as an environment variable
if [ -z "$COMMAND" ]; then
echo "Error: Please set the COMMAND environment variable."
exit 1
fi
tmp=$(mktemp -d)
(
cd $tmp
# Create named pipes (FIFOs) for stdout and stderr
mkfifo stdout.fifo stderr.fifo
# Set up tee to capture and display stdout and stderr
if [ -n "$NO_OUTPUT" ]; then
tee stdout.txt < stdout.fifo > /dev/null &
tee stderr.txt < stderr.fifo > /dev/null &
else
tee stdout.txt < stdout.fifo &
tee stderr.txt < stderr.fifo >&2 &
fi
)
# Run the command, capturing stdout and stderr in the FIFOs
set +e
eval "$COMMAND" > $tmp/stdout.fifo 2> $tmp/stderr.fifo
EXIT_CODE=$?
set -e
# Wait for all background jobs to finish
wait
# Extra trace URL
TRACE_URL=$(sed -En 's/^Full trace at (.*)/\1/p' < $tmp/stderr.txt)
{
cat <<'.'
## Dagger trace
.
if [[ "$TRACE_URL" == *"rotate dagger.cloud token for full url"* ]]; then
cat <<.
Cloud token must be rotated. Please follow these steps:
1. Go to [Dagger Cloud](https://dagger.cloud)
2. Click on your profile icon in the bottom left corner
3. Click on "Organization Settings"
4. Click on "Regenerate token"
5. Update the [\`DAGGER_CLOUD_TOKEN\` secret in your GitHub repository settings](https://github.com/${GITHUB_REPOSITORY:?Error: GITHUB_REPOSITORY is not set}/settings/secrets/actions/DAGGER_CLOUD_TOKEN)
.
elif [ -n "$TRACE_URL" ]; then
echo "[$TRACE_URL]($TRACE_URL)"
else
echo "No trace available. To setup: [https://dagger.cloud/traces/setup](https://dagger.cloud/traces/setup)"
fi
cat <<'.'
## Dagger version
```
.
dagger version
cat <<'.'
```
## Pipeline command
```bash
.
echo "DAGGER_MODULE=$DAGGER_MODULE \\"
echo " $COMMAND"
cat <<'.'
```
## Pipeline output
```
.
cat $tmp/stdout.txt
cat <<'.'
```
## Pipeline logs
```
.
tail -n 1000 $tmp/stderr.txt
cat <<'.'
```
.
} >"${GITHUB_STEP_SUMMARY}"
echo "stdout_file=$tmp/stdout.txt" >>"$GITHUB_OUTPUT"
echo "stderr_file=$tmp/stderr.txt" >>"$GITHUB_OUTPUT"
exit $EXIT_CODE
env:
_EXPERIMENTAL_DAGGER_CLOUD_TOKEN: dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw
COMMAND: dagger call -q test specific --race=true --parallel=16 --run='TestCLI|TestEngine'
DAGGER_CLOUD_TOKEN: dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw
NO_OUTPUT: "true"
shell: bash
- name: Upload call logs
uses: actions/upload-artifact@v4
with:
name: call-logs-${{ runner.name }}-${{ github.job }}exec
overwrite: "true"
path: ${{ steps.exec.outputs.stderr_file }}
if: always()
timeout-minutes: 30
test-everything-else:
runs-on:
- ${{ github.repository == 'dagger/dagger' && 'dagger-g3-v0-15-3-32c-st' || 'ubuntu-latest' }}
name: test-everything-else
steps:
- name: Checkout
uses: actions/checkout@v4
- name: scripts/install-dagger.sh
id: install-dagger
run: |
#!/bin/bash
set -o pipefail
# Fallback to /usr/local for backwards compatability
prefix_dir="${RUNNER_TEMP:-/usr/local}"
# Ensure the dir is writable otherwise fallback to tmpdir
if [[ ! -d "$prefix_dir" ]] || [[ ! -w "$prefix_dir" ]]; then
prefix_dir="$(mktemp -d)"
fi
printf '%s/bin' "$prefix_dir" >> $GITHUB_PATH
# If the dagger version is 'latest', set the version back to an empty
# string. This allows the install script to detect and install the latest
# version itself
if [[ "$DAGGER_VERSION" == "latest" ]]; then
DAGGER_VERSION=
fi
# The install.sh script creates path ${prefix_dir}/bin
curl -fsS https://dl.dagger.io/dagger/install.sh | BIN_DIR=${prefix_dir}/bin sh
env:
DAGGER_VERSION: v0.15.3
shell: bash
- name: scripts/warm-engine.sh
id: warm-engine
run: |
#!/bin/bash
# Make sure not to load any implicit module
cd $(mktemp -d)
# Run a simple query to "warm up" the engine
echo '{directory{id}}' | dagger query
shell: bash
- name: scripts/exec.sh
id: exec
run: |
#!/bin/bash --noprofile --norc -e -o pipefail
if [[ -n "$DEBUG" && "$DEBUG" != "0" ]]; then
set -x
env
which dagger
pwd
ls -l
ps aux
fi
# Detect if a dev engine is available, if so: use that
# We don't rely on PATH because the GHA runner messes with that
if [[ -n "$_EXPERIMENTAL_DAGGER_CLI_BIN" ]]; then
export PATH=$(dirname "$_EXPERIMENTAL_DAGGER_CLI_BIN"):$PATH
fi
GITHUB_STEP_SUMMARY="${GITHUB_STEP_SUMMARY:=github-summary.md}"
export NO_COLOR="${NO_COLOR:=1}" # Disable colors in dagger logs
# Ensure the command is provided as an environment variable
if [ -z "$COMMAND" ]; then
echo "Error: Please set the COMMAND environment variable."
exit 1
fi
tmp=$(mktemp -d)
(
cd $tmp
# Create named pipes (FIFOs) for stdout and stderr
mkfifo stdout.fifo stderr.fifo
# Set up tee to capture and display stdout and stderr
if [ -n "$NO_OUTPUT" ]; then
tee stdout.txt < stdout.fifo > /dev/null &
tee stderr.txt < stderr.fifo > /dev/null &
else
tee stdout.txt < stdout.fifo &
tee stderr.txt < stderr.fifo >&2 &
fi
)
# Run the command, capturing stdout and stderr in the FIFOs
set +e
eval "$COMMAND" > $tmp/stdout.fifo 2> $tmp/stderr.fifo
EXIT_CODE=$?
set -e
# Wait for all background jobs to finish
wait
# Extra trace URL
TRACE_URL=$(sed -En 's/^Full trace at (.*)/\1/p' < $tmp/stderr.txt)
{
cat <<'.'
## Dagger trace
.
if [[ "$TRACE_URL" == *"rotate dagger.cloud token for full url"* ]]; then
cat <<.
Cloud token must be rotated. Please follow these steps:
1. Go to [Dagger Cloud](https://dagger.cloud)
2. Click on your profile icon in the bottom left corner
3. Click on "Organization Settings"
4. Click on "Regenerate token"
5. Update the [\`DAGGER_CLOUD_TOKEN\` secret in your GitHub repository settings](https://github.com/${GITHUB_REPOSITORY:?Error: GITHUB_REPOSITORY is not set}/settings/secrets/actions/DAGGER_CLOUD_TOKEN)
.
elif [ -n "$TRACE_URL" ]; then
echo "[$TRACE_URL]($TRACE_URL)"
else
echo "No trace available. To setup: [https://dagger.cloud/traces/setup](https://dagger.cloud/traces/setup)"
fi
cat <<'.'
## Dagger version
```
.
dagger version
cat <<'.'
```
## Pipeline command
```bash
.
echo "DAGGER_MODULE=$DAGGER_MODULE \\"
echo " $COMMAND"
cat <<'.'
```
## Pipeline output
```
.
cat $tmp/stdout.txt
cat <<'.'
```
## Pipeline logs
```
.
tail -n 1000 $tmp/stderr.txt
cat <<'.'
```
.
} >"${GITHUB_STEP_SUMMARY}"
echo "stdout_file=$tmp/stdout.txt" >>"$GITHUB_OUTPUT"
echo "stderr_file=$tmp/stderr.txt" >>"$GITHUB_OUTPUT"
exit $EXIT_CODE
env:
_EXPERIMENTAL_DAGGER_CLOUD_TOKEN: dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw
COMMAND: dagger call -q test specific --race=true --parallel=16 --skip='TestModule|TestGo|TestPython|TestTypescript|TestElixir|TestPHP|TestCLI|TestEngine|TestProvision|TestTelemetry'
DAGGER_CLOUD_TOKEN: dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw
NO_OUTPUT: "true"
shell: bash
- name: Upload call logs
uses: actions/upload-artifact@v4
with:
name: call-logs-${{ runner.name }}-${{ github.job }}exec
overwrite: "true"
path: ${{ steps.exec.outputs.stderr_file }}
if: always()
timeout-minutes: 30
test-module-runtimes:
runs-on:
- ${{ github.repository == 'dagger/dagger' && 'dagger-g3-v0-15-3-16c-st' || 'ubuntu-latest' }}
name: test-module-runtimes
steps:
- name: Checkout
uses: actions/checkout@v4
- name: scripts/install-dagger.sh
id: install-dagger
run: |
#!/bin/bash
set -o pipefail
# Fallback to /usr/local for backwards compatability
prefix_dir="${RUNNER_TEMP:-/usr/local}"
# Ensure the dir is writable otherwise fallback to tmpdir
if [[ ! -d "$prefix_dir" ]] || [[ ! -w "$prefix_dir" ]]; then
prefix_dir="$(mktemp -d)"
fi
printf '%s/bin' "$prefix_dir" >> $GITHUB_PATH
# If the dagger version is 'latest', set the version back to an empty
# string. This allows the install script to detect and install the latest
# version itself
if [[ "$DAGGER_VERSION" == "latest" ]]; then
DAGGER_VERSION=
fi
# The install.sh script creates path ${prefix_dir}/bin
curl -fsS https://dl.dagger.io/dagger/install.sh | BIN_DIR=${prefix_dir}/bin sh
env:
DAGGER_VERSION: v0.15.3
shell: bash
- name: scripts/warm-engine.sh
id: warm-engine
run: |
#!/bin/bash
# Make sure not to load any implicit module
cd $(mktemp -d)
# Run a simple query to "warm up" the engine
echo '{directory{id}}' | dagger query
shell: bash
- name: scripts/exec.sh
id: exec
run: |
#!/bin/bash --noprofile --norc -e -o pipefail
if [[ -n "$DEBUG" && "$DEBUG" != "0" ]]; then
set -x
env
which dagger
pwd
ls -l
ps aux
fi
# Detect if a dev engine is available, if so: use that
# We don't rely on PATH because the GHA runner messes with that
if [[ -n "$_EXPERIMENTAL_DAGGER_CLI_BIN" ]]; then
export PATH=$(dirname "$_EXPERIMENTAL_DAGGER_CLI_BIN"):$PATH
fi
GITHUB_STEP_SUMMARY="${GITHUB_STEP_SUMMARY:=github-summary.md}"
export NO_COLOR="${NO_COLOR:=1}" # Disable colors in dagger logs
# Ensure the command is provided as an environment variable
if [ -z "$COMMAND" ]; then
echo "Error: Please set the COMMAND environment variable."
exit 1
fi
tmp=$(mktemp -d)
(
cd $tmp
# Create named pipes (FIFOs) for stdout and stderr
mkfifo stdout.fifo stderr.fifo
# Set up tee to capture and display stdout and stderr
if [ -n "$NO_OUTPUT" ]; then
tee stdout.txt < stdout.fifo > /dev/null &
tee stderr.txt < stderr.fifo > /dev/null &
else
tee stdout.txt < stdout.fifo &
tee stderr.txt < stderr.fifo >&2 &
fi
)
# Run the command, capturing stdout and stderr in the FIFOs
set +e
eval "$COMMAND" > $tmp/stdout.fifo 2> $tmp/stderr.fifo
EXIT_CODE=$?
set -e
# Wait for all background jobs to finish
wait
# Extra trace URL
TRACE_URL=$(sed -En 's/^Full trace at (.*)/\1/p' < $tmp/stderr.txt)
{
cat <<'.'
## Dagger trace
.
if [[ "$TRACE_URL" == *"rotate dagger.cloud token for full url"* ]]; then
cat <<.
Cloud token must be rotated. Please follow these steps:
1. Go to [Dagger Cloud](https://dagger.cloud)
2. Click on your profile icon in the bottom left corner
3. Click on "Organization Settings"
4. Click on "Regenerate token"
5. Update the [\`DAGGER_CLOUD_TOKEN\` secret in your GitHub repository settings](https://github.com/${GITHUB_REPOSITORY:?Error: GITHUB_REPOSITORY is not set}/settings/secrets/actions/DAGGER_CLOUD_TOKEN)
.
elif [ -n "$TRACE_URL" ]; then
echo "[$TRACE_URL]($TRACE_URL)"
else
echo "No trace available. To setup: [https://dagger.cloud/traces/setup](https://dagger.cloud/traces/setup)"
fi
cat <<'.'
## Dagger version
```
.
dagger version
cat <<'.'
```
## Pipeline command
```bash
.
echo "DAGGER_MODULE=$DAGGER_MODULE \\"
echo " $COMMAND"
cat <<'.'
```
## Pipeline output
```
.
cat $tmp/stdout.txt
cat <<'.'
```
## Pipeline logs
```
.
tail -n 1000 $tmp/stderr.txt
cat <<'.'
```
.
} >"${GITHUB_STEP_SUMMARY}"
echo "stdout_file=$tmp/stdout.txt" >>"$GITHUB_OUTPUT"
echo "stderr_file=$tmp/stderr.txt" >>"$GITHUB_OUTPUT"
exit $EXIT_CODE
env:
_EXPERIMENTAL_DAGGER_CLOUD_TOKEN: dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw
COMMAND: dagger call -q test specific --race=true --parallel=16 --run='TestGo|TestPython|TestTypescript|TestElixir|TestPHP'
DAGGER_CLOUD_TOKEN: dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw
NO_OUTPUT: "true"
shell: bash
- name: Upload call logs
uses: actions/upload-artifact@v4
with:
name: call-logs-${{ runner.name }}-${{ github.job }}exec
overwrite: "true"
path: ${{ steps.exec.outputs.stderr_file }}
if: always()
timeout-minutes: 30
test-modules:
runs-on:
- ${{ github.repository == 'dagger/dagger' && 'dagger-g3-v0-15-3-16c-st' || 'ubuntu-latest' }}
name: test-modules
steps:
- name: Checkout
uses: actions/checkout@v4
- name: scripts/install-dagger.sh
id: install-dagger
run: |
#!/bin/bash
set -o pipefail
# Fallback to /usr/local for backwards compatability
prefix_dir="${RUNNER_TEMP:-/usr/local}"
# Ensure the dir is writable otherwise fallback to tmpdir
if [[ ! -d "$prefix_dir" ]] || [[ ! -w "$prefix_dir" ]]; then
prefix_dir="$(mktemp -d)"
fi
printf '%s/bin' "$prefix_dir" >> $GITHUB_PATH
# If the dagger version is 'latest', set the version back to an empty
# string. This allows the install script to detect and install the latest
# version itself
if [[ "$DAGGER_VERSION" == "latest" ]]; then
DAGGER_VERSION=
fi
# The install.sh script creates path ${prefix_dir}/bin
curl -fsS https://dl.dagger.io/dagger/install.sh | BIN_DIR=${prefix_dir}/bin sh
env:
DAGGER_VERSION: v0.15.3
shell: bash
- name: scripts/warm-engine.sh
id: warm-engine
run: |
#!/bin/bash
# Make sure not to load any implicit module
cd $(mktemp -d)
# Run a simple query to "warm up" the engine
echo '{directory{id}}' | dagger query
shell: bash
- name: scripts/exec.sh
id: exec
run: |
#!/bin/bash --noprofile --norc -e -o pipefail
if [[ -n "$DEBUG" && "$DEBUG" != "0" ]]; then
set -x
env
which dagger
pwd
ls -l
ps aux
fi
# Detect if a dev engine is available, if so: use that
# We don't rely on PATH because the GHA runner messes with that
if [[ -n "$_EXPERIMENTAL_DAGGER_CLI_BIN" ]]; then
export PATH=$(dirname "$_EXPERIMENTAL_DAGGER_CLI_BIN"):$PATH
fi
GITHUB_STEP_SUMMARY="${GITHUB_STEP_SUMMARY:=github-summary.md}"
export NO_COLOR="${NO_COLOR:=1}" # Disable colors in dagger logs
# Ensure the command is provided as an environment variable
if [ -z "$COMMAND" ]; then
echo "Error: Please set the COMMAND environment variable."
exit 1
fi
tmp=$(mktemp -d)
(
cd $tmp
# Create named pipes (FIFOs) for stdout and stderr
mkfifo stdout.fifo stderr.fifo
# Set up tee to capture and display stdout and stderr
if [ -n "$NO_OUTPUT" ]; then
tee stdout.txt < stdout.fifo > /dev/null &
tee stderr.txt < stderr.fifo > /dev/null &
else
tee stdout.txt < stdout.fifo &
tee stderr.txt < stderr.fifo >&2 &
fi
)
# Run the command, capturing stdout and stderr in the FIFOs
set +e
eval "$COMMAND" > $tmp/stdout.fifo 2> $tmp/stderr.fifo
EXIT_CODE=$?
set -e
# Wait for all background jobs to finish
wait
# Extra trace URL
TRACE_URL=$(sed -En 's/^Full trace at (.*)/\1/p' < $tmp/stderr.txt)
{
cat <<'.'
## Dagger trace
.
if [[ "$TRACE_URL" == *"rotate dagger.cloud token for full url"* ]]; then
cat <<.
Cloud token must be rotated. Please follow these steps:
1. Go to [Dagger Cloud](https://dagger.cloud)
2. Click on your profile icon in the bottom left corner
3. Click on "Organization Settings"
4. Click on "Regenerate token"
5. Update the [\`DAGGER_CLOUD_TOKEN\` secret in your GitHub repository settings](https://github.com/${GITHUB_REPOSITORY:?Error: GITHUB_REPOSITORY is not set}/settings/secrets/actions/DAGGER_CLOUD_TOKEN)
.
elif [ -n "$TRACE_URL" ]; then
echo "[$TRACE_URL]($TRACE_URL)"
else
echo "No trace available. To setup: [https://dagger.cloud/traces/setup](https://dagger.cloud/traces/setup)"
fi
cat <<'.'
## Dagger version
```
.
dagger version
cat <<'.'
```
## Pipeline command
```bash
.
echo "DAGGER_MODULE=$DAGGER_MODULE \\"
echo " $COMMAND"
cat <<'.'
```
## Pipeline output
```
.
cat $tmp/stdout.txt
cat <<'.'
```
## Pipeline logs
```
.
tail -n 1000 $tmp/stderr.txt
cat <<'.'
```
.
} >"${GITHUB_STEP_SUMMARY}"
echo "stdout_file=$tmp/stdout.txt" >>"$GITHUB_OUTPUT"
echo "stderr_file=$tmp/stderr.txt" >>"$GITHUB_OUTPUT"
exit $EXIT_CODE
env:
_EXPERIMENTAL_DAGGER_CLOUD_TOKEN: dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw
COMMAND: dagger call -q test specific --race=true --parallel=16 --run='TestModule'
DAGGER_CLOUD_TOKEN: dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw
NO_OUTPUT: "true"
shell: bash
- name: Upload call logs
uses: actions/upload-artifact@v4
with:
name: call-logs-${{ runner.name }}-${{ github.job }}exec
overwrite: "true"
path: ${{ steps.exec.outputs.stderr_file }}
if: always()
timeout-minutes: 30
testdev-container:
runs-on:
- ${{ github.repository == 'dagger/dagger' && 'dagger-g3-v0-15-3-32c-dind-st' || 'ubuntu-latest' }}
name: testdev-container
steps:
- name: Checkout
uses: actions/checkout@v4
- name: scripts/install-dagger.sh
id: install-dagger
run: |
#!/bin/bash
set -o pipefail
# Fallback to /usr/local for backwards compatability
prefix_dir="${RUNNER_TEMP:-/usr/local}"
# Ensure the dir is writable otherwise fallback to tmpdir
if [[ ! -d "$prefix_dir" ]] || [[ ! -w "$prefix_dir" ]]; then
prefix_dir="$(mktemp -d)"
fi
printf '%s/bin' "$prefix_dir" >> $GITHUB_PATH
# If the dagger version is 'latest', set the version back to an empty
# string. This allows the install script to detect and install the latest
# version itself
if [[ "$DAGGER_VERSION" == "latest" ]]; then
DAGGER_VERSION=
fi
# The install.sh script creates path ${prefix_dir}/bin
curl -fsS https://dl.dagger.io/dagger/install.sh | BIN_DIR=${prefix_dir}/bin sh
env:
DAGGER_VERSION: latest
shell: bash
- name: Install go
uses: actions/setup-go@v5
with:
cache-dependency-path: .dagger/go.sum
go-version: "1.23"
- name: scripts/start-dev-dagger.sh
id: start-dev-dagger
run: |
#!/bin/bash --noprofile --norc -e -o pipefail
GITHUB_ENV="${GITHUB_ENV:=github.env}"
DAGGER_SOURCE="${DAGGER_SOURCE:=.}"
if [ ! -d "$DAGGER_SOURCE" ]; then
dagger core \
directory \
with-directory --path=. --directory="$DAGGER_SOURCE" \
export --path=dagger-source
DAGGER_SOURCE=./dagger-source
fi
echo "::group::Starting dev engine"
if ! [[ -x "$(command -v docker)" ]]; then
echo "docker is not installed"
exit 1
fi
(
cd "$DAGGER_SOURCE"/.dagger/mage
go run main.go -w ../.. engine:dev
) \
| sed 's/^export //' \
| while IFS= read -r line; do
eval echo "$line"
done \
| tee "${GITHUB_ENV}"
echo "::endgroup::"
env:
_EXPERIMENTAL_DAGGER_DEV_CONTAINER: dagger-engine.dev-${{ github.run_id }}-${{ github.job }}
_EXPERIMENTAL_DAGGER_DEV_OUTPUT: ./bin/dev-${{ github.run_id }}-${{ github.job }}
DAGGER_SOURCE: .
shell: bash
- name: scripts/warm-engine.sh
id: warm-engine
run: |
#!/bin/bash
# Make sure not to load any implicit module
cd $(mktemp -d)
# Run a simple query to "warm up" the engine
echo '{directory{id}}' | dagger query
shell: bash
- name: scripts/exec.sh
id: exec
run: |
#!/bin/bash --noprofile --norc -e -o pipefail
if [[ -n "$DEBUG" && "$DEBUG" != "0" ]]; then
set -x
env
which dagger
pwd
ls -l
ps aux
fi
# Detect if a dev engine is available, if so: use that
# We don't rely on PATH because the GHA runner messes with that
if [[ -n "$_EXPERIMENTAL_DAGGER_CLI_BIN" ]]; then
export PATH=$(dirname "$_EXPERIMENTAL_DAGGER_CLI_BIN"):$PATH
fi
GITHUB_STEP_SUMMARY="${GITHUB_STEP_SUMMARY:=github-summary.md}"
export NO_COLOR="${NO_COLOR:=1}" # Disable colors in dagger logs
# Ensure the command is provided as an environment variable
if [ -z "$COMMAND" ]; then
echo "Error: Please set the COMMAND environment variable."
exit 1
fi
tmp=$(mktemp -d)
(
cd $tmp
# Create named pipes (FIFOs) for stdout and stderr
mkfifo stdout.fifo stderr.fifo
# Set up tee to capture and display stdout and stderr
if [ -n "$NO_OUTPUT" ]; then
tee stdout.txt < stdout.fifo > /dev/null &
tee stderr.txt < stderr.fifo > /dev/null &
else
tee stdout.txt < stdout.fifo &
tee stderr.txt < stderr.fifo >&2 &
fi
)
# Run the command, capturing stdout and stderr in the FIFOs
set +e
eval "$COMMAND" > $tmp/stdout.fifo 2> $tmp/stderr.fifo
EXIT_CODE=$?
set -e
# Wait for all background jobs to finish
wait
# Extra trace URL
TRACE_URL=$(sed -En 's/^Full trace at (.*)/\1/p' < $tmp/stderr.txt)
{
cat <<'.'
## Dagger trace
.
if [[ "$TRACE_URL" == *"rotate dagger.cloud token for full url"* ]]; then
cat <<.
Cloud token must be rotated. Please follow these steps:
1. Go to [Dagger Cloud](https://dagger.cloud)
2. Click on your profile icon in the bottom left corner
3. Click on "Organization Settings"
4. Click on "Regenerate token"
5. Update the [\`DAGGER_CLOUD_TOKEN\` secret in your GitHub repository settings](https://github.com/${GITHUB_REPOSITORY:?Error: GITHUB_REPOSITORY is not set}/settings/secrets/actions/DAGGER_CLOUD_TOKEN)
.
elif [ -n "$TRACE_URL" ]; then
echo "[$TRACE_URL]($TRACE_URL)"
else
echo "No trace available. To setup: [https://dagger.cloud/traces/setup](https://dagger.cloud/traces/setup)"
fi
cat <<'.'
## Dagger version
```
.
dagger version
cat <<'.'
```
## Pipeline command
```bash
.
echo "DAGGER_MODULE=$DAGGER_MODULE \\"
echo " $COMMAND"
cat <<'.'
```
## Pipeline output
```
.
cat $tmp/stdout.txt
cat <<'.'
```
## Pipeline logs
```
.
tail -n 1000 $tmp/stderr.txt
cat <<'.'
```
.
} >"${GITHUB_STEP_SUMMARY}"
echo "stdout_file=$tmp/stdout.txt" >>"$GITHUB_OUTPUT"
echo "stderr_file=$tmp/stderr.txt" >>"$GITHUB_OUTPUT"
exit $EXIT_CODE
env:
_EXPERIMENTAL_DAGGER_CLOUD_TOKEN: dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw
COMMAND: dagger call -q test specific --race=true --parallel=16 --run='TestContainer'
DAGGER_CLOUD_TOKEN: dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw
NO_OUTPUT: "true"
shell: bash
- name: Upload call logs
uses: actions/upload-artifact@v4
with:
name: call-logs-${{ runner.name }}-${{ github.job }}exec
overwrite: "true"
path: ${{ steps.exec.outputs.stderr_file }}
if: always()
- name: Capture dev engine logs
run: docker logs "dagger-engine.dev-${{ github.run_id }}-${{ github.job }}" &> /tmp/actions-call-engine.log
shell: bash
if: always()
- name: Upload dev engine logs
uses: actions/upload-artifact@v4
with:
name: engine-logs-${{ runner.name }}-${{ github.job }}
overwrite: "true"
path: /tmp/actions-call-engine.log
if: always()
timeout-minutes: 30
testdev-module-runtimes:
runs-on:
- ${{ github.repository == 'dagger/dagger' && 'dagger-g3-v0-15-3-32c-dind-st' || 'ubuntu-latest' }}
name: testdev-module-runtimes
steps:
- name: Checkout
uses: actions/checkout@v4
- name: scripts/install-dagger.sh
id: install-dagger
run: |
#!/bin/bash
set -o pipefail
# Fallback to /usr/local for backwards compatability
prefix_dir="${RUNNER_TEMP:-/usr/local}"
# Ensure the dir is writable otherwise fallback to tmpdir
if [[ ! -d "$prefix_dir" ]] || [[ ! -w "$prefix_dir" ]]; then
prefix_dir="$(mktemp -d)"
fi
printf '%s/bin' "$prefix_dir" >> $GITHUB_PATH
# If the dagger version is 'latest', set the version back to an empty
# string. This allows the install script to detect and install the latest
# version itself
if [[ "$DAGGER_VERSION" == "latest" ]]; then
DAGGER_VERSION=
fi
# The install.sh script creates path ${prefix_dir}/bin
curl -fsS https://dl.dagger.io/dagger/install.sh | BIN_DIR=${prefix_dir}/bin sh
env:
DAGGER_VERSION: latest
shell: bash
- name: Install go
uses: actions/setup-go@v5
with:
cache-dependency-path: .dagger/go.sum
go-version: "1.23"
- name: scripts/start-dev-dagger.sh
id: start-dev-dagger
run: |
#!/bin/bash --noprofile --norc -e -o pipefail
GITHUB_ENV="${GITHUB_ENV:=github.env}"
DAGGER_SOURCE="${DAGGER_SOURCE:=.}"
if [ ! -d "$DAGGER_SOURCE" ]; then
dagger core \
directory \
with-directory --path=. --directory="$DAGGER_SOURCE" \
export --path=dagger-source
DAGGER_SOURCE=./dagger-source
fi
echo "::group::Starting dev engine"
if ! [[ -x "$(command -v docker)" ]]; then
echo "docker is not installed"
exit 1
fi
(
cd "$DAGGER_SOURCE"/.dagger/mage
go run main.go -w ../.. engine:dev
) \
| sed 's/^export //' \
| while IFS= read -r line; do
eval echo "$line"
done \
| tee "${GITHUB_ENV}"
echo "::endgroup::"
env:
_EXPERIMENTAL_DAGGER_DEV_CONTAINER: dagger-engine.dev-${{ github.run_id }}-${{ github.job }}
_EXPERIMENTAL_DAGGER_DEV_OUTPUT: ./bin/dev-${{ github.run_id }}-${{ github.job }}
DAGGER_SOURCE: .
shell: bash
- name: scripts/warm-engine.sh
id: warm-engine
run: |
#!/bin/bash
# Make sure not to load any implicit module
cd $(mktemp -d)
# Run a simple query to "warm up" the engine
echo '{directory{id}}' | dagger query
shell: bash
- name: scripts/exec.sh
id: exec
run: |
#!/bin/bash --noprofile --norc -e -o pipefail
if [[ -n "$DEBUG" && "$DEBUG" != "0" ]]; then
set -x
env
which dagger
pwd
ls -l
ps aux
fi
# Detect if a dev engine is available, if so: use that
# We don't rely on PATH because the GHA runner messes with that
if [[ -n "$_EXPERIMENTAL_DAGGER_CLI_BIN" ]]; then
export PATH=$(dirname "$_EXPERIMENTAL_DAGGER_CLI_BIN"):$PATH
fi
GITHUB_STEP_SUMMARY="${GITHUB_STEP_SUMMARY:=github-summary.md}"
export NO_COLOR="${NO_COLOR:=1}" # Disable colors in dagger logs
# Ensure the command is provided as an environment variable
if [ -z "$COMMAND" ]; then
echo "Error: Please set the COMMAND environment variable."
exit 1
fi
tmp=$(mktemp -d)
(
cd $tmp
# Create named pipes (FIFOs) for stdout and stderr
mkfifo stdout.fifo stderr.fifo
# Set up tee to capture and display stdout and stderr
if [ -n "$NO_OUTPUT" ]; then
tee stdout.txt < stdout.fifo > /dev/null &
tee stderr.txt < stderr.fifo > /dev/null &
else
tee stdout.txt < stdout.fifo &
tee stderr.txt < stderr.fifo >&2 &
fi
)
# Run the command, capturing stdout and stderr in the FIFOs
set +e
eval "$COMMAND" > $tmp/stdout.fifo 2> $tmp/stderr.fifo
EXIT_CODE=$?
set -e
# Wait for all background jobs to finish
wait
# Extra trace URL
TRACE_URL=$(sed -En 's/^Full trace at (.*)/\1/p' < $tmp/stderr.txt)
{
cat <<'.'
## Dagger trace
.
if [[ "$TRACE_URL" == *"rotate dagger.cloud token for full url"* ]]; then
cat <<.
Cloud token must be rotated. Please follow these steps:
1. Go to [Dagger Cloud](https://dagger.cloud)
2. Click on your profile icon in the bottom left corner
3. Click on "Organization Settings"
4. Click on "Regenerate token"
5. Update the [\`DAGGER_CLOUD_TOKEN\` secret in your GitHub repository settings](https://github.com/${GITHUB_REPOSITORY:?Error: GITHUB_REPOSITORY is not set}/settings/secrets/actions/DAGGER_CLOUD_TOKEN)
.
elif [ -n "$TRACE_URL" ]; then
echo "[$TRACE_URL]($TRACE_URL)"
else
echo "No trace available. To setup: [https://dagger.cloud/traces/setup](https://dagger.cloud/traces/setup)"
fi
cat <<'.'
## Dagger version
```
.
dagger version
cat <<'.'
```
## Pipeline command
```bash
.
echo "DAGGER_MODULE=$DAGGER_MODULE \\"
echo " $COMMAND"
cat <<'.'
```
## Pipeline output
```
.
cat $tmp/stdout.txt
cat <<'.'
```
## Pipeline logs
```
.
tail -n 1000 $tmp/stderr.txt
cat <<'.'
```
.
} >"${GITHUB_STEP_SUMMARY}"
echo "stdout_file=$tmp/stdout.txt" >>"$GITHUB_OUTPUT"
echo "stderr_file=$tmp/stderr.txt" >>"$GITHUB_OUTPUT"
exit $EXIT_CODE
env:
_EXPERIMENTAL_DAGGER_CLOUD_TOKEN: dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw
COMMAND: dagger call -q test specific --race=true --parallel=16 --run='TestGo|TestPython|TestTypescript|TestElixir|TestPHP'
DAGGER_CLOUD_TOKEN: dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw
NO_OUTPUT: "true"
shell: bash
- name: Upload call logs
uses: actions/upload-artifact@v4
with:
name: call-logs-${{ runner.name }}-${{ github.job }}exec
overwrite: "true"
path: ${{ steps.exec.outputs.stderr_file }}
if: always()
- name: Capture dev engine logs
run: docker logs "dagger-engine.dev-${{ github.run_id }}-${{ github.job }}" &> /tmp/actions-call-engine.log
shell: bash
if: always()
- name: Upload dev engine logs
uses: actions/upload-artifact@v4
with:
name: engine-logs-${{ runner.name }}-${{ github.job }}
overwrite: "true"
path: /tmp/actions-call-engine.log
if: always()
timeout-minutes: 30
testdev-modules:
runs-on:
- ${{ github.repository == 'dagger/dagger' && 'dagger-g3-v0-15-3-32c-dind-st' || 'ubuntu-latest' }}
name: testdev-modules
steps:
- name: Checkout
uses: actions/checkout@v4
- name: scripts/install-dagger.sh
id: install-dagger
run: |
#!/bin/bash
set -o pipefail
# Fallback to /usr/local for backwards compatability
prefix_dir="${RUNNER_TEMP:-/usr/local}"
# Ensure the dir is writable otherwise fallback to tmpdir
if [[ ! -d "$prefix_dir" ]] || [[ ! -w "$prefix_dir" ]]; then
prefix_dir="$(mktemp -d)"
fi
printf '%s/bin' "$prefix_dir" >> $GITHUB_PATH
# If the dagger version is 'latest', set the version back to an empty
# string. This allows the install script to detect and install the latest
# version itself
if [[ "$DAGGER_VERSION" == "latest" ]]; then
DAGGER_VERSION=
fi
# The install.sh script creates path ${prefix_dir}/bin
curl -fsS https://dl.dagger.io/dagger/install.sh | BIN_DIR=${prefix_dir}/bin sh
env:
DAGGER_VERSION: latest
shell: bash
- name: Install go
uses: actions/setup-go@v5
with:
cache-dependency-path: .dagger/go.sum
go-version: "1.23"
- name: scripts/start-dev-dagger.sh
id: start-dev-dagger
run: |
#!/bin/bash --noprofile --norc -e -o pipefail
GITHUB_ENV="${GITHUB_ENV:=github.env}"
DAGGER_SOURCE="${DAGGER_SOURCE:=.}"
if [ ! -d "$DAGGER_SOURCE" ]; then
dagger core \
directory \
with-directory --path=. --directory="$DAGGER_SOURCE" \
export --path=dagger-source
DAGGER_SOURCE=./dagger-source
fi
echo "::group::Starting dev engine"
if ! [[ -x "$(command -v docker)" ]]; then
echo "docker is not installed"
exit 1
fi
(
cd "$DAGGER_SOURCE"/.dagger/mage
go run main.go -w ../.. engine:dev
) \
| sed 's/^export //' \
| while IFS= read -r line; do
eval echo "$line"
done \
| tee "${GITHUB_ENV}"
echo "::endgroup::"
env:
_EXPERIMENTAL_DAGGER_DEV_CONTAINER: dagger-engine.dev-${{ github.run_id }}-${{ github.job }}
_EXPERIMENTAL_DAGGER_DEV_OUTPUT: ./bin/dev-${{ github.run_id }}-${{ github.job }}
DAGGER_SOURCE: .
shell: bash
- name: scripts/warm-engine.sh
id: warm-engine
run: |
#!/bin/bash
# Make sure not to load any implicit module
cd $(mktemp -d)
# Run a simple query to "warm up" the engine
echo '{directory{id}}' | dagger query
shell: bash
- name: scripts/exec.sh
id: exec
run: |
#!/bin/bash --noprofile --norc -e -o pipefail
if [[ -n "$DEBUG" && "$DEBUG" != "0" ]]; then
set -x
env
which dagger
pwd
ls -l
ps aux
fi
# Detect if a dev engine is available, if so: use that
# We don't rely on PATH because the GHA runner messes with that
if [[ -n "$_EXPERIMENTAL_DAGGER_CLI_BIN" ]]; then
export PATH=$(dirname "$_EXPERIMENTAL_DAGGER_CLI_BIN"):$PATH
fi
GITHUB_STEP_SUMMARY="${GITHUB_STEP_SUMMARY:=github-summary.md}"
export NO_COLOR="${NO_COLOR:=1}" # Disable colors in dagger logs
# Ensure the command is provided as an environment variable
if [ -z "$COMMAND" ]; then
echo "Error: Please set the COMMAND environment variable."
exit 1
fi
tmp=$(mktemp -d)
(
cd $tmp
# Create named pipes (FIFOs) for stdout and stderr
mkfifo stdout.fifo stderr.fifo
# Set up tee to capture and display stdout and stderr
if [ -n "$NO_OUTPUT" ]; then
tee stdout.txt < stdout.fifo > /dev/null &
tee stderr.txt < stderr.fifo > /dev/null &
else
tee stdout.txt < stdout.fifo &
tee stderr.txt < stderr.fifo >&2 &
fi
)
# Run the command, capturing stdout and stderr in the FIFOs
set +e
eval "$COMMAND" > $tmp/stdout.fifo 2> $tmp/stderr.fifo
EXIT_CODE=$?
set -e
# Wait for all background jobs to finish
wait
# Extra trace URL
TRACE_URL=$(sed -En 's/^Full trace at (.*)/\1/p' < $tmp/stderr.txt)
{
cat <<'.'
## Dagger trace
.
if [[ "$TRACE_URL" == *"rotate dagger.cloud token for full url"* ]]; then
cat <<.
Cloud token must be rotated. Please follow these steps:
1. Go to [Dagger Cloud](https://dagger.cloud)
2. Click on your profile icon in the bottom left corner
3. Click on "Organization Settings"
4. Click on "Regenerate token"
5. Update the [\`DAGGER_CLOUD_TOKEN\` secret in your GitHub repository settings](https://github.com/${GITHUB_REPOSITORY:?Error: GITHUB_REPOSITORY is not set}/settings/secrets/actions/DAGGER_CLOUD_TOKEN)
.
elif [ -n "$TRACE_URL" ]; then
echo "[$TRACE_URL]($TRACE_URL)"
else
echo "No trace available. To setup: [https://dagger.cloud/traces/setup](https://dagger.cloud/traces/setup)"
fi
cat <<'.'
## Dagger version
```
.
dagger version
cat <<'.'
```
## Pipeline command
```bash
.
echo "DAGGER_MODULE=$DAGGER_MODULE \\"
echo " $COMMAND"
cat <<'.'
```
## Pipeline output
```
.
cat $tmp/stdout.txt
cat <<'.'
```
## Pipeline logs
```
.
tail -n 1000 $tmp/stderr.txt
cat <<'.'
```
.
} >"${GITHUB_STEP_SUMMARY}"
echo "stdout_file=$tmp/stdout.txt" >>"$GITHUB_OUTPUT"
echo "stderr_file=$tmp/stderr.txt" >>"$GITHUB_OUTPUT"
exit $EXIT_CODE
env:
_EXPERIMENTAL_DAGGER_CLOUD_TOKEN: dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw
COMMAND: dagger call -q test specific --race=true --parallel=16 --run='TestModule'
DAGGER_CLOUD_TOKEN: dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw
NO_OUTPUT: "true"
shell: bash
- name: Upload call logs
uses: actions/upload-artifact@v4
with:
name: call-logs-${{ runner.name }}-${{ github.job }}exec
overwrite: "true"
path: ${{ steps.exec.outputs.stderr_file }}
if: always()
- name: Capture dev engine logs
run: docker logs "dagger-engine.dev-${{ github.run_id }}-${{ github.job }}" &> /tmp/actions-call-engine.log
shell: bash
if: always()
- name: Upload dev engine logs
uses: actions/upload-artifact@v4
with:
name: engine-logs-${{ runner.name }}-${{ github.job }}
overwrite: "true"
path: /tmp/actions-call-engine.log
if: always()
timeout-minutes: 30