Skip to content

Commit

Permalink
Make the build workflows only check out .github/ and patches/ from ma…
Browse files Browse the repository at this point in the history
…ster
  • Loading branch information
jwodder committed Nov 14, 2023
1 parent 5c3f4a7 commit de692d2
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ jobs:
run: |
# The goal here is for $BUILD_COMMIT to be the HEAD (necessary for
# git-annex's version detection to use the correct git commit) with
# the contents of master — or whatever ref is being used as the
# workflow source — also available.
# the .github/ and patches/ trees from master — or whatever ref is
# being used as the workflow source — also available.
git checkout "$BUILD_COMMIT"
git checkout "$GITHUB_SHA" -- .
git checkout "$GITHUB_SHA" -- .github patches
- name: Get build version
id: build-version
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ jobs:
run: |
# The goal here is for $BUILD_COMMIT to be the HEAD (necessary for
# git-annex's version detection to use the correct git commit) with
# the contents of master — or whatever ref is being used as the
# workflow source — also available.
# the .github/ and patches/ trees from master — or whatever ref is
# being used as the workflow source — also available.
git checkout "$BUILD_COMMIT"
git checkout "$GITHUB_SHA" -- .
git checkout "$GITHUB_SHA" -- .github patches
- name: Get build version
id: build-version
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ jobs:
run: |
# The goal here is for $BUILD_COMMIT to be the HEAD (necessary for
# git-annex's version detection to use the correct git commit) with
# the contents of master — or whatever ref is being used as the
# workflow source — also available.
# the .github/ and patches/ trees from master — or whatever ref is
# being used as the workflow source — also available.
git reset --soft "$BUILD_COMMIT"
# Avoid checking out unnecessary files with paths that are invalid on
# Windows.
git ls-tree --name-only HEAD | grep -v '^doc$' | xargs git checkout HEAD
git checkout HEAD doc/license ':(glob)doc/*.mdwn' ':(glob)doc/logo*'
git checkout "$GITHUB_SHA" -- .
git checkout "$GITHUB_SHA" -- .github patches
- name: Get build version
id: build-version
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/template/build-{{ostype}}.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
build-version: ${{ steps.build-version.outputs.version }}
steps:
- name: Checkout this repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down Expand Up @@ -96,8 +96,8 @@ jobs:
run: |
# The goal here is for $BUILD_COMMIT to be the HEAD (necessary for
# git-annex's version detection to use the correct git commit) with
# the contents of master — or whatever ref is being used as the
# workflow source — also available.
# the .github/ and patches/ trees from master — or whatever ref is
# being used as the workflow source — also available.
{% if ostype == "windows" %}
git reset --soft "$BUILD_COMMIT"
# Avoid checking out unnecessary files with paths that are invalid on
Expand All @@ -107,7 +107,7 @@ jobs:
{% else %}
git checkout "$BUILD_COMMIT"
{% endif %}
git checkout "$GITHUB_SHA" -- .
git checkout "$GITHUB_SHA" -- .github patches

- name: Get build version
id: build-version
Expand Down Expand Up @@ -277,7 +277,7 @@ jobs:
{% if ostype == "ubuntu" %}
- name: Clone datalad/git-annex-ci-client-jobs
if: contains(fromJSON('["schedule", "workflow_dispatch"]'), github.event_name)
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: datalad/git-annex-ci-client-jobs
fetch-depth: 1
Expand Down Expand Up @@ -384,7 +384,7 @@ jobs:
{% endif %}
steps:
- name: Checkout this repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Create pending PR status
if: github.event.inputs.pr != ''
Expand Down Expand Up @@ -539,7 +539,7 @@ jobs:
needs: build-package
steps:
- name: Checkout this repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Create pending PR status
if: github.event.inputs.pr != ''
Expand Down Expand Up @@ -600,7 +600,7 @@ jobs:
fail-fast: false
steps:
- name: Checkout this repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Create pending PR status
if: github.event.inputs.pr != ''
Expand Down Expand Up @@ -732,7 +732,7 @@ jobs:

# needed for ssh certs under ubuntu and tox.ini everywhere
- name: Checkout datalad
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: datalad/datalad
path: datalad
Expand Down

0 comments on commit de692d2

Please sign in to comment.