Benchmark #10
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
name: Benchmark | |
on: | |
# Run the workflow every day at 5AM UTC | |
# That's 9PM PST, 12AM EST, 6AM CET | |
schedule: | |
- cron: "0 5 * * *" | |
# Enable manual trigger for easy debugging | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pull-requests: write | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
benchmark-go: | |
name: Benchmark (Go) | |
runs-on: "dagger-g2-main-4c" | |
if: ${{ github.repository == 'dagger/dagger' }} | |
timeout-minutes: 10 | |
steps: | |
- name: dagger init (go) | |
shell: bash | |
run: | | |
mkdir -p /tmp/benchmark | |
cd /tmp/benchmark | |
dagger init --name=benchmark --sdk=go | |
env: | |
DAGGER_CLOUD_TOKEN: "dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw" | |
- name: dagger functions@initial (go) | |
shell: bash | |
run: | | |
dagger functions | |
working-directory: /tmp/benchmark | |
env: | |
DAGGER_CLOUD_TOKEN: "dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw" | |
- name: dagger functions@cached (go) | |
shell: bash | |
run: | | |
dagger functions | |
working-directory: /tmp/benchmark | |
env: | |
DAGGER_CLOUD_TOKEN: "dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw" | |
- name: dagger functions@modified (go) | |
shell: bash | |
run: | | |
# invalidate the cache by modifying the source files | |
[ -f "main.go" ] && echo >> main.go | |
dagger functions | |
working-directory: /tmp/benchmark | |
env: | |
DAGGER_CLOUD_TOKEN: "dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw" | |
benchmark-python: | |
name: Benchmark (Python) | |
runs-on: "dagger-g2-main-4c" | |
if: ${{ github.repository == 'dagger/dagger' }} | |
timeout-minutes: 10 | |
steps: | |
- name: dagger init (python) | |
shell: bash | |
run: | | |
mkdir -p /tmp/benchmark | |
cd /tmp/benchmark | |
dagger init --name=benchmark --sdk=python | |
env: | |
DAGGER_CLOUD_TOKEN: "dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw" | |
- name: dagger functions@initial (python) | |
shell: bash | |
run: | | |
dagger functions | |
working-directory: /tmp/benchmark | |
env: | |
DAGGER_CLOUD_TOKEN: "dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw" | |
- name: dagger functions@cached (python) | |
shell: bash | |
run: | | |
dagger functions | |
working-directory: /tmp/benchmark | |
env: | |
DAGGER_CLOUD_TOKEN: "dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw" | |
- name: dagger functions@modified (python) | |
shell: bash | |
run: | | |
# invalidate the cache by modifying the source files | |
[ -f "src/main/__init__.py" ] && echo >> src/main/__init__.py | |
dagger functions | |
working-directory: /tmp/benchmark | |
env: | |
DAGGER_CLOUD_TOKEN: "dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw" | |
benchmark-typescript: | |
name: Benchmark (TypeScript::${{ matrix.package-manager }}) | |
runs-on: "dagger-g2-main-4c" | |
if: ${{ github.repository == 'dagger/dagger' }} | |
timeout-minutes: 10 | |
strategy: | |
matrix: | |
package-manager: [pnpm, yarn, yarnv4, npm, bun] | |
steps: | |
- name: dagger init (typescript::${{ matrix.package-manager }}) | |
shell: bash | |
run: | | |
mkdir -p /tmp/benchmark | |
cd /tmp/benchmark | |
if [ "${{ matrix.package-manager }}" == "pnpm" ]; then | |
cat << EOF > package.json | |
{ | |
"type": "module", | |
"dependencies": { | |
"typescript": "^5.5.4", | |
"@dagger.io/dagger": "./sdk" | |
}, | |
"packageManager": "[email protected]" | |
} | |
EOF | |
fi | |
if [ "${{ matrix.package-manager }}" == "npm" ]; then | |
cat << EOF > package.json | |
{ | |
"type": "module", | |
"dependencies": { | |
"typescript": "^5.5.4", | |
"@dagger.io/dagger": "./sdk" | |
}, | |
"packageManager": "[email protected]" | |
} | |
EOF | |
fi | |
if [ "${{ matrix.package-manager }}" == "yarn" ]; then | |
cat << EOF > package.json | |
{ | |
"type": "module", | |
"dependencies": { | |
"typescript": "^5.5.4", | |
"@dagger.io/dagger": "./sdk" | |
}, | |
"packageManager": "[email protected]" | |
} | |
EOF | |
fi | |
if [ "${{ matrix.package-manager }}" == "yarnv4" ]; then | |
cat << EOF > package.json | |
{ | |
"type": "module", | |
"dependencies": { | |
"typescript": "^5.5.4", | |
"@dagger.io/dagger": "./sdk" | |
}, | |
"packageManager": "[email protected]" | |
} | |
EOF | |
fi | |
if [ "${{ matrix.package-manager }}" == "bun" ]; then | |
cat << EOF > package.json | |
{ | |
"type": "module", | |
"dependencies": { | |
"typescript": "^5.5.4", | |
"@dagger.io/dagger": "./sdk" | |
}, | |
"dagger": { | |
"runtime": "bun" | |
} | |
} | |
EOF | |
fi | |
dagger init --name=benchmark --sdk=typescript | |
env: | |
DAGGER_CLOUD_TOKEN: "dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw" | |
- name: dagger functions@initial (typescript::${{ matrix.package-manager }}) | |
shell: bash | |
run: | | |
dagger functions | |
working-directory: /tmp/benchmark | |
env: | |
DAGGER_CLOUD_TOKEN: "dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw" | |
- name: dagger functions@cached (typescript::${{ matrix.package-manager }}) | |
shell: bash | |
run: | | |
dagger functions | |
working-directory: /tmp/benchmark | |
env: | |
DAGGER_CLOUD_TOKEN: "dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw" | |
- name: dagger functions@modified (typescript::${{ matrix.package-manager }}) | |
shell: bash | |
run: | | |
# invalidate the cache by modifying the source files | |
[ -f "src/index.ts" ] && echo >> src/index.ts | |
dagger functions | |
working-directory: /tmp/benchmark | |
env: | |
DAGGER_CLOUD_TOKEN: "dag_dagger_sBIv6DsjNerWvTqt2bSFeigBUqWxp9bhh3ONSSgeFnw" |