Skip to content

Commit 2014f78

Browse files
committed
[static] Merge remote-tracking branch 'origin/main' into isegall/snyk
Signed-off-by: Itai Segall <itai.segall@digitalasset.com>
2 parents 5da0d71 + b3dc3fd commit 2014f78

File tree

83 files changed

+2478
-735
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+2478
-735
lines changed

.github/actions/tests/pre_scala_test/action.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,15 @@ runs:
3232
using: "composite"
3333
steps:
3434
- name: Check if static only
35+
uses: ./.github/actions/tests/skip_on_static
36+
id: check
37+
38+
- name: Skip if static only
39+
if: steps.check.outputs.skip == 'true'
3540
shell: bash
3641
run: |
37-
last_commit_msg=$(git log -1 --pretty=%B)
38-
echo "Last commit message: $last_commit_msg"
39-
if [[ "${{ github.event_name }}" == "pull_request"* ]] && [[ "$last_commit_msg" == *"[static]"* ]]; then
40-
echo "Only static tests should be running, skipping this job"
41-
echo "skip=true" >> "$GITHUB_ENV"
42-
else
43-
echo "Not static-test-only, continuing"
44-
fi
42+
echo "Only static tests should be running, skipping this job"
43+
echo "skip=true" >> "$GITHUB_ENV"
4544
4645
- name: Check if skip regex matches
4746
if: ${{ inputs.skip_if_regex != '' }}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Check for static tests only
2+
description: |
3+
This action checks if the current PR is only for static tests (via a commit flag ot a PR label).
4+
5+
outputs:
6+
skip:
7+
description: "Set to true if the job should be skipped"
8+
value: ${{ steps.check.outputs.skip }}
9+
10+
runs:
11+
using: "composite"
12+
steps:
13+
- name: Check if static only
14+
id: check
15+
shell: bash
16+
run: |
17+
last_commit_msg=$(git log -1 --pretty=%B)
18+
pr_labels='${{ toJSON(github.event.pull_request.labels) }}'
19+
static_label=$(echo "$pr_labels" | jq -r '.[] | select(.name == "static") | .name' | grep -c 'static' || true)
20+
echo "Last commit message: $last_commit_msg"
21+
if [[ "${{ github.event_name }}" == "pull_request"* ]]; then
22+
if [[ "$last_commit_msg" == *"[static]"* ]] || [[ "$static_label" -gt 0 ]]; then
23+
echo "Only static tests should be running"
24+
echo "Last commit message is: $last_commit_msg"
25+
echo "Static label count: $static_label (all labels: $pr_labels)"
26+
echo "skip=true" >> "$GITHUB_OUTPUT"
27+
else
28+
echo "Not static-test-only"
29+
echo "skip=false" >> "$GITHUB_OUTPUT"
30+
fi
31+
else
32+
echo "Not a pull_request or pull_request_target event, not checking for static-test-only flag"
33+
echo "skip=false" >> "$GITHUB_OUTPUT"
34+
fi
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
name: Add labels to PRs from forks
1+
name: Auto-assign PRs from forks
22

33
on:
44
pull_request_target:
55
types: [opened, reopened, edited]
66

77
jobs:
8-
add_labels:
8+
assign:
99
runs-on: self-hosted-docker-tiny
1010
if: github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
1111
steps:
@@ -14,10 +14,9 @@ jobs:
1414
with:
1515
script: |
1616
const pr = context.payload.pull_request;
17-
const labels = ['fork'];
18-
await github.rest.issues.addLabels({
17+
await github.rest.issues.addAssignees({
1918
issue_number: pr.number,
2019
owner: pr.base.repo.owner.login,
2120
repo: pr.base.repo.name,
22-
labels: labels,
21+
assignees: ['isegall-da', 'martinflorian-da', 'ray-roestenburg-da'],
2322
});

.github/workflows/build.daml_test.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ on:
44
inputs:
55
commit_sha:
66
type: string
7-
required: false
8-
default: ""
7+
required: true
98

109
jobs:
1110
daml_test:
@@ -20,20 +19,9 @@ jobs:
2019
with:
2120
ref: ${{ inputs.commit_sha }}
2221

23-
- name: Skip on [static]
22+
- name: Check if static only
23+
uses: ./.github/actions/tests/skip_on_static
2424
id: skip
25-
shell: bash
26-
run: |
27-
git fetch origin ${{ github.event.pull_request.head.sha }}
28-
last_commit_msg=$(git log -1 --pretty=%B ${{ github.event.pull_request.head.sha }})
29-
echo "Last commit message: $last_commit_msg"
30-
31-
if [[ "${{ github.event_name }}" == "pull_request" ]] || [[ "${{ github.event_name }}" == "pull_request_target" ]]; then
32-
if [[ "$last_commit_msg" == *"[static]"* ]]; then
33-
echo "Skipping Daml tests because of [static] label"
34-
echo "skip=true" >> "$GITHUB_OUTPUT"
35-
fi
36-
fi
3725

3826
- name: Setup
3927
if: steps.skip.outputs.skip != 'true'

.github/workflows/build.deployment_test.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ on:
44
inputs:
55
commit_sha:
66
type: string
7-
required: false
8-
default: ""
7+
required: true
98

109
jobs:
1110
deployment_test:

.github/workflows/build.docs.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ on:
44
inputs:
55
commit_sha:
66
type: string
7-
required: false
8-
default: ""
7+
required: true
98

109
jobs:
1110
docs:

.github/workflows/build.scala_test.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ on:
4848
default: true
4949
commit_sha:
5050
type: string
51-
required: false
52-
default: ""
51+
required: true
5352
daml_base_version:
5453
description: "Splice version from which the initial-package-config should be chosen"
5554
type: string

.github/workflows/build.scala_test_for_compose.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ on:
2323
required: true
2424
commit_sha:
2525
type: string
26-
required: false
27-
default: ""
26+
required: true
2827
daml_base_version:
2928
description: "Splice version from which the initial-package-config should be chosen"
3029
type: string

.github/workflows/build.scala_test_with_cometbft.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ on:
1616
required: true
1717
commit_sha:
1818
type: string
19-
required: false
20-
default: ""
19+
required: true
2120
daml_base_version:
2221
description: "Splice version from which the initial-package-config should be chosen"
2322
type: string

.github/workflows/build.static_tests.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ on:
44
inputs:
55
commit_sha:
66
type: string
7-
required: false
8-
default: ""
7+
required: true
98

109

1110
jobs:

0 commit comments

Comments
 (0)