Skip to content

Commit

Permalink
ci: Use proper SHA when downloading core
Browse files Browse the repository at this point in the history
This allows to directly download PR commits and avoid tricks with
local copy. This improves dependencies resolving when PR added
new external repo.
  • Loading branch information
sjanc committed Nov 17, 2023
1 parent 22ebb10 commit 0425c1f
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 11 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/build_blinky.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ jobs:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- uses: actions/setup-go@v3
with:
go-version: 'stable'
Expand All @@ -53,8 +55,9 @@ jobs:
cp -f .github/project.yml build/project.yml
cd build
newt upgrade --shallow=1
rm -rf repos/apache-mynewt-core
git clone .. repos/apache-mynewt-core
git -C repos/apache-mynewt-core fetch $GITHUB_SHA
sed -i "s/0.0.0/$GITHUB_SHA-commit/g" project.yml
newt upgrade --shallow=1
cd ..
- name: Build Blinky
shell: bash
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/build_bootloader.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ jobs:
cp -f .github/project.yml build/project.yml
cd build
newt upgrade --shallow=1
rm -rf repos/apache-mynewt-core
git clone .. repos/apache-mynewt-core
SHA=`git rev-parse HEAD`
git -C repos/apache-mynewt-core fetch $SHA
sed -i "s/0.0.0/$SHA-commit/g" project.yml
newt upgrade --shallow=1
cd ..
- name: Build bootloader
shell: bash
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/build_cc_target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ jobs:
cp -f .github/project.yml build/project.yml
cd build
newt upgrade --shallow=1
rm -rf repos/apache-mynewt-core
git clone .. repos/apache-mynewt-core
SHA=`git rev-parse HEAD`
git -C repos/apache-mynewt-core fetch $SHA
sed -i "s/0.0.0/$SHA-commit/g" project.yml
newt upgrade --shallow=1
cd ..
- name: Build targets
shell: bash
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/build_targets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ jobs:
cp -f .github/project.yml build/project.yml
cd build
newt upgrade --shallow=1
SHA=`git rev-parse HEAD`
git -C repos/apache-mynewt-core fetch $SHA
sed -i "s/0.0.0/$SHA-commit/g" project.yml
newt upgrade --shallow=1
rm -rf targets
rm -rf repos/apache-mynewt-core
git clone .. repos/apache-mynewt-core
cd ..
- name: Build targets
shell: bash
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/newt_test_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ jobs:
cp -f .github/project.yml build/project.yml
cd build
newt upgrade --shallow=1
rm -rf repos/apache-mynewt-core
git clone .. repos/apache-mynewt-core
SHA=`git rev-parse HEAD`
git -C repos/apache-mynewt-core fetch $SHA
sed -i "s/0.0.0/$SHA-commit/g" project.yml
newt upgrade --shallow=1
cd ..
- name: newt test all
run: |
Expand Down

0 comments on commit 0425c1f

Please sign in to comment.