Skip to content

Commit ad9b7b4

Browse files
committed
Make use of shared workflows
Signed-off-by: Albert Callarisa <albert@diagrid.io>
1 parent d2c7c50 commit ad9b7b4

4 files changed

Lines changed: 22 additions & 225 deletions

File tree

.github/scripts/automerge.py

Lines changed: 0 additions & 73 deletions
This file was deleted.

.github/workflows/backport.yaml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#
1313

1414
name: Backport
15+
1516
on:
1617
pull_request_target:
1718
types:
@@ -20,18 +21,6 @@ on:
2021

2122
jobs:
2223
backport:
23-
name: Backport
24-
runs-on: ubuntu-latest
25-
if: >
26-
github.event.pull_request.merged
27-
&& (
28-
github.event.action == 'closed'
29-
|| (
30-
github.event.action == 'labeled'
31-
&& contains(github.event.label.name, 'backport')
32-
)
33-
)
34-
steps:
35-
- uses: tibdex/backport@9565281eda0731b1d20c4025c43339fb0a23812e
36-
with:
37-
github_token: ${{ secrets.DAPR_BOT_TOKEN }}
24+
uses: dapr/.github/.github/workflows/backport.yaml@main
25+
secrets:
26+
dapr_bot_token: ${{ secrets.DAPR_BOT_TOKEN }}

.github/workflows/dapr-bot-schedule.yml

Lines changed: 15 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -17,53 +17,21 @@ on:
1717
schedule:
1818
- cron: '*/10 * * * *'
1919
workflow_dispatch:
20+
2021
jobs:
2122
automerge:
22-
if: github.repository_owner == 'dapr'
23-
name: Automerge and update PRs.
24-
runs-on: ubuntu-latest
25-
steps:
26-
- name: Checkout repo
27-
uses: actions/checkout@v6
28-
- name: Install dependencies
29-
run: pip install PyGithub
30-
- name: Automerge and update
31-
env:
32-
MAINTAINERS: berndverst,wcs1only
33-
GITHUB_TOKEN: ${{ secrets.DAPR_BOT_TOKEN }}
34-
run: python ./.github/scripts/automerge.py
23+
uses: dapr/.github/.github/workflows/automerge.yaml@main
24+
with:
25+
maintainer-teams: python-sdk-maintainers
26+
secrets:
27+
dapr_bot_token: ${{ secrets.DAPR_BOT_TOKEN }}
28+
3529
prune_stale:
36-
name: Prune Stale
37-
runs-on: ubuntu-latest
38-
steps:
39-
- name: Prune Stale
40-
uses: actions/stale@v5
41-
with:
42-
repo-token: ${{ secrets.DAPR_BOT_TOKEN }}
43-
# Different amounts of days for issues/PRs are not currently supported but there is a PR
44-
# open for it: https://github.com/actions/stale/issues/214
45-
days-before-stale: 60
46-
days-before-close: 7
47-
stale-issue-message: >
48-
This issue has been automatically marked as stale because it has not had activity in the
49-
last 60 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity
50-
occurs. Thank you for your contributions.
51-
close-issue-message: >
52-
This issue has been automatically closed because it has not had activity in the
53-
last 67 days. If this issue is still valid, please ping a maintainer and ask them to label it as pinned, good first issue, help wanted or triaged/resolved.
54-
Thank you for your contributions.
55-
stale-pr-message: >
56-
This pull request has been automatically marked as stale because it has not had
57-
activity in the last 60 days. It will be closed in 7 days if no further activity occurs. Please
58-
feel free to give a status update now, ping for review, or re-open when it's ready.
59-
Thank you for your contributions!
60-
close-pr-message: >
61-
This pull request has been automatically closed because it has not had
62-
activity in the last 67 days. Please feel free to give a status update now, ping for review, or re-open when it's ready.
63-
Thank you for your contributions!
64-
stale-issue-label: 'stale'
65-
exempt-issue-labels: 'pinned,good first issue,help wanted,triaged/resolved'
66-
stale-pr-label: 'stale'
67-
exempt-pr-labels: 'pinned'
68-
operations-per-run: 500
69-
ascending: true
30+
uses: dapr/.github/.github/workflows/prune-stale.yaml@main
31+
with:
32+
days-before-issue-stale: 60
33+
days-before-pr-stale: 60
34+
days-before-issue-close: 7
35+
days-before-pr-close: 7
36+
secrets:
37+
dapr_bot_token: ${{ secrets.DAPR_BOT_TOKEN }}

.github/workflows/validate_examples.yaml

Lines changed: 3 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,13 @@ on:
1919
- release-*
2020
- feature/*
2121
workflow_dispatch:
22-
inputs:
23-
daprdapr_commit:
24-
description: 'Dapr/Dapr commit to build custom daprd from'
25-
required: false
26-
default: ''
27-
daprcli_commit:
28-
description: 'Dapr/CLI commit to build custom dapr CLI from'
29-
required: false
30-
default: ''
3122
repository_dispatch:
3223
types: [validate-examples]
3324
merge_group:
3425
jobs:
3526
validate:
3627
runs-on: ubuntu-latest
3728
env:
38-
GOVER: 1.21
39-
GOOS: linux
40-
GOARCH: amd64
41-
GOPROXY: https://proxy.golang.org
42-
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/master/install/install.sh
43-
DAPR_CLI_REF: ${{ github.event.inputs.daprcli_commit }}
44-
DAPR_REF: ${{ github.event.inputs.daprdapr_commit }}
4529
CHECKOUT_REPO: ${{ github.repository }}
4630
CHECKOUT_REF: ${{ github.ref }}
4731

@@ -56,7 +40,6 @@ jobs:
5640
if [ ${{ github.event.client_payload.command }} = "ok-to-test" ]; then
5741
echo "CHECKOUT_REPO=${{ github.event.client_payload.pull_head_repo }}" >> $GITHUB_ENV
5842
echo "CHECKOUT_REF=${{ github.event.client_payload.pull_head_ref }}" >> $GITHUB_ENV
59-
echo "DAPR_REF=master" >> $GITHUB_ENV
6043
fi
6144
6245
- name: Check out code onto GOPATH
@@ -65,30 +48,6 @@ jobs:
6548
repository: ${{ env.CHECKOUT_REPO }}
6649
ref: ${{ env.CHECKOUT_REF }}
6750
- uses: azure/setup-helm@v4
68-
- name: Determine latest Dapr Runtime version (including prerelease)
69-
env:
70-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71-
run: |
72-
RUNTIME_VERSION=$(curl -fsS -H "Authorization: Bearer $GITHUB_TOKEN" \
73-
"https://api.github.com/repos/dapr/dapr/releases?per_page=10" | \
74-
jq -r 'sort_by(.created_at) | reverse | .[0].tag_name | ltrimstr("v")')
75-
if [ -z "$RUNTIME_VERSION" ] || [ "$RUNTIME_VERSION" = "null" ]; then
76-
echo "Failed to resolve Dapr Runtime version" && exit 1
77-
fi
78-
echo "DAPR_RUNTIME_VER=$RUNTIME_VERSION" >> $GITHUB_ENV
79-
echo "Found $RUNTIME_VERSION"
80-
- name: Determine latest Dapr CLI version (including prerelease)
81-
env:
82-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83-
run: |
84-
CLI_VERSION=$(curl -fsS -H "Authorization: Bearer $GITHUB_TOKEN" \
85-
"https://api.github.com/repos/dapr/cli/releases?per_page=10" | \
86-
jq -r 'sort_by(.created_at) | reverse | .[0].tag_name | ltrimstr("v")')
87-
if [ -z "$CLI_VERSION" ] || [ "$CLI_VERSION" = "null" ]; then
88-
echo "Failed to resolve Dapr CLI version" && exit 1
89-
fi
90-
echo "DAPR_CLI_VER=$CLI_VERSION" >> $GITHUB_ENV
91-
echo "Found $CLI_VERSION"
9251
- name: Set up Python ${{ matrix.python_ver }}
9352
uses: actions/setup-python@v6
9453
with:
@@ -98,61 +57,15 @@ jobs:
9857
python -m pip install --upgrade pip
9958
pip install setuptools wheel twine tox
10059
- name: Set up Dapr CLI
101-
run: |
102-
wget -q "https://github.com/dapr/cli/releases/download/v${{ env.DAPR_CLI_VER }}/dapr_${{ env.GOOS }}_${{ env.GOARCH }}.tar.gz" -O /tmp/dapr.tar.gz
103-
sudo tar xzf /tmp/dapr.tar.gz -C /usr/local/bin dapr
104-
dapr --version
105-
- name: Set up Go ${{ env.GOVER }}
106-
if: env.DAPR_REF != '' || env.DAPR_CLI_REF != ''
107-
uses: actions/setup-go@v5
108-
with:
109-
go-version: ${{ env.GOVER }}
60+
uses: dapr/.github/.github/actions/setup-dapr-cli@main
61+
- name: Set up Dapr runtime
62+
uses: dapr/.github/.github/actions/setup-dapr-runtime@main
11063
- name: Set up Llama
11164
run: |
11265
curl -fsSL https://ollama.com/install.sh | sh
11366
nohup ollama serve &
11467
sleep 10
11568
ollama pull llama3.2:latest
116-
- name: Checkout Dapr CLI repo to override dapr command.
117-
uses: actions/checkout@v6
118-
if: env.DAPR_CLI_REF != ''
119-
with:
120-
repository: dapr/cli
121-
ref: ${{ env.DAPR_CLI_REF }}
122-
path: cli
123-
- name: Checkout Dapr repo to override daprd.
124-
uses: actions/checkout@v6
125-
if: env.DAPR_REF != ''
126-
with:
127-
repository: dapr/dapr
128-
ref: ${{ env.DAPR_REF }}
129-
path: dapr_runtime
130-
- name: Build and override dapr cli with referenced commit.
131-
if: env.DAPR_CLI_REF != ''
132-
run: |
133-
cd cli
134-
make
135-
sudo cp dist/linux_amd64/release/dapr /usr/local/bin/dapr
136-
cd ..
137-
- name: Initialize Dapr runtime ${{ env.DAPR_RUNTIME_VER }}
138-
run: |
139-
dapr uninstall --all
140-
dapr init --runtime-version ${{ env.DAPR_RUNTIME_VER }}
141-
- name: Build and override daprd with referenced commit.
142-
if: env.DAPR_REF != ''
143-
run: |
144-
cd dapr_runtime
145-
make
146-
mkdir -p $HOME/.dapr/bin/
147-
cp dist/linux_amd64/release/daprd $HOME/.dapr/bin/daprd
148-
cd ..
149-
- name: Override placement service.
150-
if: env.DAPR_REF != ''
151-
run: |
152-
docker stop dapr_placement
153-
cd dapr_runtime
154-
./dist/linux_amd64/release/placement --healthz-port 9091 &
155-
cd ..
15669
- name: Check Examples
15770
run: |
15871
tox -e examples

0 commit comments

Comments
 (0)