Skip to content

Commit dc44685

Browse files
acrocasicoyle
andauthored
Make use of shared workflows (#950)
* Make use of shared workflows Signed-off-by: Albert Callarisa <albert@diagrid.io> * Keep inputs for the commit SHA in the CLI and runtime Signed-off-by: Albert Callarisa <albert@diagrid.io> --------- Signed-off-by: Albert Callarisa <albert@diagrid.io> Co-authored-by: Sam <sam@diagrid.io>
1 parent 3647c6c commit dc44685

4 files changed

Lines changed: 27 additions & 191 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: 8 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,6 @@ jobs:
2929
validate:
3030
runs-on: ubuntu-latest
3131
env:
32-
GOVER: 1.21
33-
GOOS: linux
34-
GOARCH: amd64
35-
GOPROXY: https://proxy.golang.org
36-
DAPR_INSTALL_URL: https://raw.githubusercontent.com/dapr/cli/master/install/install.sh
37-
DAPR_CLI_REF: ${{ github.event.inputs.daprcli_commit }}
38-
DAPR_REF: ${{ github.event.inputs.daprdapr_commit }}
3932
CHECKOUT_REPO: ${{ github.repository }}
4033
CHECKOUT_REF: ${{ github.ref }}
4134

@@ -50,7 +43,6 @@ jobs:
5043
if [ ${{ github.event.client_payload.command }} = "ok-to-test" ]; then
5144
echo "CHECKOUT_REPO=${{ github.event.client_payload.pull_head_repo }}" >> $GITHUB_ENV
5245
echo "CHECKOUT_REF=${{ github.event.client_payload.pull_head_ref }}" >> $GITHUB_ENV
53-
echo "DAPR_REF=master" >> $GITHUB_ENV
5446
fi
5547
5648
- name: Check out code onto GOPATH
@@ -96,61 +88,21 @@ jobs:
9688
python -m pip install --upgrade pip
9789
pip install setuptools wheel twine tox
9890
- name: Set up Dapr CLI
99-
run: |
100-
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
101-
sudo tar xzf /tmp/dapr.tar.gz -C /usr/local/bin dapr
102-
dapr --version
103-
- name: Set up Go ${{ env.GOVER }}
104-
if: env.DAPR_REF != '' || env.DAPR_CLI_REF != ''
105-
uses: actions/setup-go@v6
91+
uses: dapr/.github/.github/actions/setup-dapr-cli@main
92+
with:
93+
commit: ${{ github.event.inputs.daprcli_commit }}
94+
github-token: ${{ secrets.GITHUB_TOKEN }}
95+
- name: Set up Dapr runtime
96+
uses: dapr/.github/.github/actions/setup-dapr-runtime@main
10697
with:
107-
go-version: ${{ env.GOVER }}
98+
commit: ${{ github.event.inputs.daprdapr_commit }}
99+
github-token: ${{ secrets.GITHUB_TOKEN }}
108100
- name: Set up Llama
109101
run: |
110102
curl -fsSL https://ollama.com/install.sh | sh
111103
nohup ollama serve &
112104
sleep 10
113105
ollama pull llama3.2:latest
114-
- name: Checkout Dapr CLI repo to override dapr command.
115-
uses: actions/checkout@v6
116-
if: env.DAPR_CLI_REF != ''
117-
with:
118-
repository: dapr/cli
119-
ref: ${{ env.DAPR_CLI_REF }}
120-
path: cli
121-
- name: Checkout Dapr repo to override daprd.
122-
uses: actions/checkout@v6
123-
if: env.DAPR_REF != ''
124-
with:
125-
repository: dapr/dapr
126-
ref: ${{ env.DAPR_REF }}
127-
path: dapr_runtime
128-
- name: Build and override dapr cli with referenced commit.
129-
if: env.DAPR_CLI_REF != ''
130-
run: |
131-
cd cli
132-
make
133-
sudo cp dist/linux_amd64/release/dapr /usr/local/bin/dapr
134-
cd ..
135-
- name: Initialize Dapr runtime ${{ env.DAPR_RUNTIME_VER }}
136-
run: |
137-
dapr uninstall --all
138-
dapr init --runtime-version ${{ env.DAPR_RUNTIME_VER }}
139-
- name: Build and override daprd with referenced commit.
140-
if: env.DAPR_REF != ''
141-
run: |
142-
cd dapr_runtime
143-
make
144-
mkdir -p $HOME/.dapr/bin/
145-
cp dist/linux_amd64/release/daprd $HOME/.dapr/bin/daprd
146-
cd ..
147-
- name: Override placement service.
148-
if: env.DAPR_REF != ''
149-
run: |
150-
docker stop dapr_placement
151-
cd dapr_runtime
152-
./dist/linux_amd64/release/placement --healthz-port 9091 &
153-
cd ..
154106
- name: Check Examples
155107
run: |
156108
tox -e examples

0 commit comments

Comments
 (0)