From fb3cd53d80b29a7382be51bb1a0196467efd9c72 Mon Sep 17 00:00:00 2001 From: Gerard Bosch Date: Thu, 14 Dec 2023 20:00:20 +0100 Subject: [PATCH] Test dependent workflows: With reusable workflows --- .github/workflows/work1.yml | 3 ++- .github/workflows/work2.yml | 11 +++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/work1.yml b/.github/workflows/work1.yml index d78a300..c4de686 100644 --- a/.github/workflows/work1.yml +++ b/.github/workflows/work1.yml @@ -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. @@ -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: ' diff --git a/.github/workflows/work2.yml b/.github/workflows/work2.yml index 3ece0f0..82ba791 100644 --- a/.github/workflows/work2.yml +++ b/.github/workflows/work2.yml @@ -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