Skip to content

Commit

Permalink
Test dependent workflows: With reusable workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
gerardbosch committed Dec 14, 2023
1 parent 33eaa0c commit fb3cd53
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/work1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: 'work1'

# Controls when the action will run
on:
workflow_call:
push:
branches:
- '**' # '*' Matches zero or more characters, but does not match the `/` character. '**' matches zero or more of any character.
Expand All @@ -14,7 +15,7 @@ jobs:
runs-on: 'ubuntu-latest'

steps:
- name: 'w1-step1'
- name: 'w1-j1-step1'
run: |
date '+%F %H:%M:%S' > time.txt
echo '*** WRITTEN time: '
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/work2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,19 @@ on:

jobs:
job1:
runs-on: 'ubuntu-latest'
needs: 'work1.job1'

uses: ./.github/workflows/work1.yml
# job1:
# runs-on: 'ubuntu-latest'
#
job2:
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: time

- name: 'w2-step2'
- name: 'w2-j2-step2'
run: |
echo '*** READ time: '
cat time.txt

0 comments on commit fb3cd53

Please sign in to comment.