Skip to content

Commit

Permalink
Propagates commits in v8build.
Browse files Browse the repository at this point in the history
Otherwise sub-workflows will try to checkout the original HEAD.
  • Loading branch information
tommie committed Jul 17, 2024
1 parent 2d3d622 commit 8432b0f
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/leakcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ on:
pull_request:
workflow_dispatch:
workflow_call:
inputs:
sha:
description: "The commit to check out at. Defaults to the parent workflow's github.sha."
required: false
type: string

jobs:
test:
Expand All @@ -20,6 +25,8 @@ jobs:

- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.sha }}

- name: Set Up Workspace
# Submodules shouldn't cause a download.
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,45 @@ on:
default: false
required: true
type: boolean
sha:
description: "The commit to check out at. Defaults to the parent workflow's github.sha."
required: false
type: string
version:
description: The version to release as. If it starts with a plus, it is relative to the previous release.
required: true
type: string
outputs:
sha:
description: The resulting SHA commitish.
value: ${{ jobs.release.outputs.sha }}

jobs:
test:
name: Test
uses: ./.github/workflows/test.yml
with:
sha: ${{ inputs.sha }}

leakcheck:
name: Test (leakcheck)
uses: ./.github/workflows/leakcheck.yml
with:
sha: ${{ inputs.sha }}

release:
name: Release
needs: [test, leakcheck]
runs-on: ubuntu-latest
outputs:
committed: ${{ steps.commit_changelog.outputs.committed }}
sha: ${{ steps.commit_changelog.outputs.commit_long_sha }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ inputs.sha }}

- name: Mark Release In Changelog
if: ${{ inputs.version }}
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/syncsubdeps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,30 @@ on:
- "deps/*_*/**"
workflow_dispatch:
workflow_call:
inputs:
sha:
description: "The commit to check out at. Defaults to the parent workflow's github.sha."
required: false
type: string
outputs:
sha:
description: The resulting SHA commitish.
value: ${{ jobs.sync.outputs.sha }}

jobs:
sync:
name: Sync
runs-on: ubuntu-latest
outputs:
committed: ${{ steps.commit.outputs.committed }}
sha: ${{ steps.commit.outputs.commit_long_sha }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# Our git log in deps/ requires an arbitrarily deep history.
fetch-depth: 0
ref: ${{ inputs.sha }}

- id: info
name: Extract Information
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ on:
pull_request:
workflow_dispatch:
workflow_call:
inputs:
sha:
description: "The commit to check out at. Defaults to the parent workflow's github.sha."
required: false
type: string

jobs:
test:
Expand Down Expand Up @@ -38,6 +43,8 @@ jobs:

- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.sha }}

- name: Set Up Workspace
# Submodules shouldn't cause a download.
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/v8build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ on:
- deps/latest_v8_hash
workflow_dispatch:
workflow_call:
inputs:
sha:
description: "The commit to check out at. Defaults to the parent workflow's github.sha."
required: false
type: string
outputs:
sha:
description: The resulting SHA commitish.
value: ${{ jobs.release.outputs.sha }}

jobs:
build_common:
Expand All @@ -20,6 +29,7 @@ jobs:
with:
submodules: true
fetch-depth: 1
ref: ${{ inputs.sha }}

- name: Update to latest V8
run: |
Expand Down Expand Up @@ -88,6 +98,7 @@ jobs:
with:
submodules: true
fetch-depth: 1
ref: ${{ inputs.sha }}

- name: Update to latest V8
run: |
Expand Down Expand Up @@ -147,12 +158,14 @@ jobs:
runs-on: ubuntu-latest
outputs:
committed: ${{ steps.commit.outputs.committed }}
sha: ${{ steps.commit.outputs.commit_long_sha }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 1
ref: ${{ inputs.sha }}

- id: update_v8
name: Update to latest V8
Expand Down Expand Up @@ -224,6 +237,8 @@ jobs:
needs: commit
if: ${{ needs.commit.outputs.committed == 'true' }}
uses: ./.github/workflows/syncsubdeps.yml
with:
sha: ${{ needs.commit.outputs.sha }}

release:
name: Make A Release
Expand All @@ -233,3 +248,4 @@ jobs:
with:
draft: false
version: '+0.1.0'
sha: ${{ needs.syncsubdeps.outputs.sha }}
3 changes: 3 additions & 0 deletions .github/workflows/v8upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
committed: ${{ steps.commit.outputs.committed }}
sha: ${{ steps.commit.outputs.commit_long_sha }}
has_upgrade: ${{ steps.check_v8.outputs.has_upgrade }}
latest_v8_hash: ${{ steps.check_v8.outputs.latest_v8_hash }}
steps:
Expand Down Expand Up @@ -62,3 +63,5 @@ jobs:
needs: upgrade
if: ${{ needs.upgrade.outputs.committed == 'true' }}
uses: ./.github/workflows/v8build.yml
with:
sha: ${{ needs.upgrade.outputs.sha }}

0 comments on commit 8432b0f

Please sign in to comment.