-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (59 loc) 路 2.87 KB
/
playground.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# this is our action playground which is triggered whenever this file is changes
name: playground
on:
push:
paths: [ '.github/workflows/playground.yml' ]
jobs:
playground-job:
name: Come out and play 1
runs-on: ubuntu-latest
#permissions:
# packages: write # required to write / cleanup container registry
# contents: write # for releases
steps:
- name: Install latest rubin Kafka Record producer
run: |
echo "Tempdir runner.temp: ${{ runner.temp }}"
curl -LsSo ${{ runner.temp }}/rubin.zip $(curl -LsS 'https://api.github.com/repos/tillkuhn/rubin/releases/latest' | jq -r '.assets[] | select(.name|endswith("linux_amd64.zip")).browser_download_url')
unzip ${{ runner.temp }}/rubin.zip -d ${{ runner.temp }} && chmod u+g ${{ runner.temp }}/rubin
mkdir app/
echo hase >app/app1
echo hase >app/app2
- name: Upload binaries built by go-releaser
uses: actions/upload-artifact@v4
with:
name: go-releaser-binaries
path: app/
if-no-files-found: error
retention-days: 1
- name: Test Kafka Messaging
id: test-kafka-messaging
# GitHub vars: https://dev.to/mihinduranasinghe/working-with-environment-variables-github-actions-part-2-46po
# Default Env Vars: https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
# https://stackoverflow.com/questions/59073850/github-actions-get-url-of-test-build
# GITHUB_REPOSITORY=<github-org>/rubin
# GITHUB_ACTION=test-kafka-messaging name or id (if present) of the step
# GITHUB_JOB=playground-job The job_id of the current job. For example, greeting_job.
# GITHUB_WORKFLOW=playground name of the workflow on top, or basename of yml file
run: |
${{ runner.temp }}/rubin -ce -key "${GITHUB_REPOSITORY}/$GITHUB_JOB" \
-source "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
-type "net.timafe.event.ci.published.v1" -subject "${GITHUB_REPOSITORY}/some-subject" \
-record "{\"action\":\"$GITHUB_ACTION\",\"version\":\"${GITHUB_REF#refs/*/}\",\"commit\":\"$GITHUB_SHA\",\"repository\":\"$GITHUB_REPOSITORY\",\"actor\":\"$GITHUB_ACTOR\"}" \
-header "producer=rubin"
env:
KAFKA_PRODUCER_TOPIC_URL: ${{ secrets.KAFKA_PRODUCER_TOPIC_URL }}
KAFKA_PRODUCER_API_SECRET: ${{ secrets.KAFKA_PRODUCER_API_SECRET }}
playground-job2:
name: Come out and play 2
runs-on: ubuntu-latest
needs: [playground-job]
steps:
- name: Download binaries built by go-releaser from previous job
uses: actions/download-artifact@v4
with:
name: go-releaser-binaries
path: app2/ # this path will contain app1 and app2
- name: look
run: |
ls -l app2/