Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/actionlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
self-hosted-runner:
labels:
- self-hosted-docker-tiny
- self-hosted-docker-medium
- self-hosted-docker-large
- self-hosted-k8s-x-small
- self-hosted-k8s-small
- self-hosted-k8s-medium
- self-hosted-k8s-large
- self-hosted-k8s-x-large
34 changes: 34 additions & 0 deletions .github/actions/cache/daml_artifacts/restore/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "Restore Daml artifacts"
description: "Restore the Daml artifacts cache"
inputs:
cache_version:
description: "Version of the cache"
required: true
outputs:
cache_hit:
description: "Cache hit"
value: ${{ steps.restore.outputs.cache-hit }}

runs:
using: "composite"
steps:
- name: Restore Daml artifacts cache
id: restore
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: |
/tmp/daml
apps/common/frontend/daml.js
key: daml-artifacts-${{ inputs.cache_version }} branch:${{ github.ref_name }} dependencies:${{ hashFiles('project/build.properties', 'project/BuildCommon.scala', 'project/DamlPlugin.scala', 'build.sbt', 'daml/dars.lock', 'nix/canton-sources.json') }} rev:${{ github.sha }}
restore-keys: |
daml-artifacts-${{ inputs.cache_version }} branch:${{ github.ref_name }} dependencies:${{ hashFiles('project/build.properties', 'project/BuildCommon.scala', 'project/DamlPlugin.scala', 'build.sbt', 'daml/dars.lock', 'nix/canton-sources.json') }}
daml-artifacts-${{ inputs.cache_version }} branch:main dependencies:${{ hashFiles('project/build.properties', 'project/BuildCommon.scala', 'project/DamlPlugin.scala', 'build.sbt', 'daml/dars.lock', 'nix/canton-sources.json') }}
- name: Extract Daml artifacts
shell: bash
run: |
if [[ -e /tmp/daml/daml.tar.gz ]]; then
tar --use-compress-program=pigz -xf /tmp/daml/daml.tar.gz
else
echo "No cached daml artifacts files found. Skipping..."
fi

32 changes: 32 additions & 0 deletions .github/actions/cache/daml_artifacts/save/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: "Save Daml artifacts"
description: "Saves the Daml artifacts to the cache"
inputs:
cache_version:
description: "Version of the cache"
required: true
load_cache_hit:
description: "Cache hit from the restore Daml artifacts job (should be the cache_hit output from the restore Daml artifacts job)"
required: true

runs:
using: "composite"
steps:
- name: Archive Daml artifacts
if: ${{ ! fromJson(inputs.load_cache_hit) }}
shell: bash
run: |
mkdir -p /tmp/daml
find . -type d -name ".daml" | tar --use-compress-program=pigz -cf /tmp/daml/daml.tar.gz -T -
- name: Not archiving Daml artifacts
if: ${{ fromJson(inputs.load_cache_hit) }}
shell: bash
run: |
echo "Skipping Daml artifacts cache, as there was a cache hit"
- name: Cache precompiled classes
if: ${{ ! fromJson(inputs.load_cache_hit) }}
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: |
/tmp/daml
apps/common/frontend/daml.js
key: daml-artifacts-${{ inputs.cache_version }} branch:${{ github.ref_name }} dependencies:${{ hashFiles('project/build.properties', 'project/BuildCommon.scala', 'project/DamlPlugin.scala', 'build.sbt', 'daml/dars.lock', 'nix/canton-sources.json') }} rev:${{ github.sha }}
32 changes: 32 additions & 0 deletions .github/actions/cache/frontend_node_modules/restore/action.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions .github/actions/cache/frontend_node_modules/save/action.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions .github/actions/cache/precompiled_classes/restore/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: "Restore Precompiled Classes"
description: "Restore the precompiled classes from the cache"
inputs:
cache_version:
description: "Version of the cache"
required: true
outputs:
cache_hit:
description: "Cache hit"
value: ${{ steps.restore.outputs.cache-hit }}

runs:
using: "composite"
steps:
- name: Restore precompiled classes
id: restore
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: /tmp/classes
key: classes-${{ inputs.cache_version }} branch:${{ github.ref_name }} dependencies:${{ hashFiles('project/build.properties', 'project/BuildCommon.scala', 'project/DamlPlugin.scala', 'project/Dependencies.scala', 'project/CantonDependencies.scala', 'project/Houserules.scala', 'project/plugins.sbt', 'build.sbt', 'daml/dars.lock', 'openapi-cache-key.txt') }} rev:${{ github.sha }}
restore-keys: |
classes-${{ inputs.cache_version }} branch:${{ github.ref_name }} dependencies:${{ hashFiles('project/build.properties', 'project/BuildCommon.scala', 'project/DamlPlugin.scala', 'project/Dependencies.scala', 'project/CantonDependencies.scala', 'project/Houserules.scala', 'project/plugins.sbt', 'build.sbt', 'daml/dars.lock', 'openapi-cache-key.txt') }}
classes-${{ inputs.cache_version }} branch:main dependencies:${{ hashFiles('project/build.properties', 'project/BuildCommon.scala', 'project/DamlPlugin.scala', 'project/Dependencies.scala', 'project/CantonDependencies.scala', 'project/Houserules.scala', 'project/plugins.sbt', 'build.sbt', 'daml/dars.lock', 'openapi-cache-key.txt') }}
- name: Extract precompiled classes
shell: bash
run: ./.github/actions/scripts/extract_precompiled_classes.sh
28 changes: 28 additions & 0 deletions .github/actions/cache/precompiled_classes/save/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Save Precompiled Classes"
description: "Saves the precompiled classes to the cache"
inputs:
cache_version:
description: "Version of the cache"
required: true
load_cache_hit:
description: "Cache hit from the load precompiled classes job (should be the cache_hit output from the load precompiled classes job)"
required: true

runs:
using: "composite"
steps:
- name: Archive precompiled classes
if: ${{ ! fromJson(inputs.load_cache_hit) }}
shell: bash
run: ./.github/actions/scripts/archive_precompiled_classes.sh
- name: Not archiving preceompiled classes
if: ${{ fromJson(inputs.load_cache_hit) }}
shell: bash
run: |
echo "Skipping precompiled classes cache, as there was a cache hit"
- name: Cache precompiled classes
if: ${{ ! fromJson(inputs.load_cache_hit) }}
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: /tmp/classes
key: classes-${{ inputs.cache_version }} branch:${{ github.ref_name }} dependencies:${{ hashFiles('project/build.properties', 'project/BuildCommon.scala', 'project/DamlPlugin.scala', 'project/Dependencies.scala', 'project/CantonDependencies.scala', 'project/Houserules.scala', 'project/plugins.sbt', 'build.sbt', 'daml/dars.lock', 'openapi-cache-key.txt') }} rev:${{ github.sha }}
24 changes: 24 additions & 0 deletions .github/actions/cache/sbt/restore/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "Restore SBT Cacht"
description: "Restore the SBT cache"
inputs:
cache_version:
description: "Version of the cache"
required: true
outputs:
cache_hit:
description: "Cache hit"
value: ${{ steps.restore.outputs.cache-hit }}

runs:
using: "composite"
steps:
- name: Restore SBT cache
id: restore
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: |
/github/home/.ivy2/cache
/github/home/.sbt
key: sbt-${{ inputs.cache_version }} job=${{ github.job }} dependencies=${{ hashFiles('project/Dependencies.scala', 'project/CantonDependencies.scala') }}-${{ hashFiles('project/BuildCommon.scala', 'project/build.properties', 'project/Houserules.scala', 'project/plugins.sbt', 'build.sbt') }}
restore-keys: |
sbt-${{ inputs.cache_version }} job=${{ github.job }} dependencies=${{ hashFiles('project/Dependencies.scala', 'project/CantonDependencies.scala') }}
26 changes: 26 additions & 0 deletions .github/actions/cache/sbt/save/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: "Save SBT Cache"
description: "Saves the SBT cache"
inputs:
cache_version:
description: "Version of the cache"
required: true
load_cache_hit:
description: "Cache hit from the restore SBT job (should be the cache_hit output from the restore SBT job)"
required: true

runs:
using: "composite"
steps:
- name: Store SBT cache
if: ${{ ! fromJson(inputs.load_cache_hit) }}
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: |
/github/home/.ivy2/cache
/github/home/.sbt
key: sbt-${{ inputs.cache_version }} job=${{ github.job }} dependencies=${{ hashFiles('project/Dependencies.scala', 'project/CantonDependencies.scala') }}-${{ hashFiles('project/BuildCommon.scala', 'project/build.properties', 'project/Houserules.scala', 'project/plugins.sbt', 'build.sbt') }}
- name: Not storing SBT cache
if: ${{ fromJson(inputs.load_cache_hit) }}
shell: bash
run: |
echo "Skipping SBT cache, as there was a cache hit"
Loading
Loading