Skip to content

Commit 448de1f

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

4 files changed

Lines changed: 22 additions & 208 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 & 73 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,16 +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-
run: |
70-
RUNTIME_VERSION=$(curl -s "https://api.github.com/repos/dapr/dapr/releases" | sort -r | grep '"tag_name"' | head -n 1 | cut -d ':' -f2 | tr -d '",v ')
71-
echo "DAPR_RUNTIME_VER=$RUNTIME_VERSION" >> $GITHUB_ENV
72-
echo "Found $RUNTIME_VERSION"
73-
- name: Determine latest Dapr Cli version (including prerelease)
74-
run: |
75-
CLI_VERSION=$(curl -s "https://api.github.com/repos/dapr/cli/releases" | sort -r | grep '"tag_name"' | head -n 1 | cut -d ':' -f2 | tr -d '",v ')
76-
echo "DAPR_CLI_VER=$CLI_VERSION" >> $GITHUB_ENV
77-
echo "Found $CLI_VERSION"
7851
- name: Set up Python ${{ matrix.python_ver }}
7952
uses: actions/setup-python@v6
8053
with:
@@ -84,58 +57,15 @@ jobs:
8457
python -m pip install --upgrade pip
8558
pip install setuptools wheel twine tox
8659
- name: Set up Dapr CLI
87-
run: wget -q ${{ env.DAPR_INSTALL_URL }} -O - | /bin/bash -s ${{ env.DAPR_CLI_VER }}
88-
- name: Set up Go ${{ env.GOVER }}
89-
if: env.DAPR_REF != '' || env.DAPR_CLI_REF != ''
90-
uses: actions/setup-go@v5
91-
with:
92-
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
9363
- name: Set up Llama
9464
run: |
9565
curl -fsSL https://ollama.com/install.sh | sh
9666
nohup ollama serve &
9767
sleep 10
9868
ollama pull llama3.2:latest
99-
- name: Checkout Dapr CLI repo to override dapr command.
100-
uses: actions/checkout@v6
101-
if: env.DAPR_CLI_REF != ''
102-
with:
103-
repository: dapr/cli
104-
ref: ${{ env.DAPR_CLI_REF }}
105-
path: cli
106-
- name: Checkout Dapr repo to override daprd.
107-
uses: actions/checkout@v6
108-
if: env.DAPR_REF != ''
109-
with:
110-
repository: dapr/dapr
111-
ref: ${{ env.DAPR_REF }}
112-
path: dapr_runtime
113-
- name: Build and override dapr cli with referenced commit.
114-
if: env.DAPR_CLI_REF != ''
115-
run: |
116-
cd cli
117-
make
118-
sudo cp dist/linux_amd64/release/dapr /usr/local/bin/dapr
119-
cd ..
120-
- name: Initialize Dapr runtime ${{ env.DAPR_RUNTIME_VER }}
121-
run: |
122-
dapr uninstall --all
123-
dapr init --runtime-version ${{ env.DAPR_RUNTIME_VER }}
124-
- name: Build and override daprd with referenced commit.
125-
if: env.DAPR_REF != ''
126-
run: |
127-
cd dapr_runtime
128-
make
129-
mkdir -p $HOME/.dapr/bin/
130-
cp dist/linux_amd64/release/daprd $HOME/.dapr/bin/daprd
131-
cd ..
132-
- name: Override placement service.
133-
if: env.DAPR_REF != ''
134-
run: |
135-
docker stop dapr_placement
136-
cd dapr_runtime
137-
./dist/linux_amd64/release/placement --healthz-port 9091 &
138-
cd ..
13969
- name: Check Examples
14070
run: |
14171
tox -e examples

0 commit comments

Comments
 (0)