mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-09 22:18:00 +00:00
refactor cargo-check-benches logic
* fix fetch refspec * assume base is master if the api call fails * merge master into pr branch rather than the other way around; same effect but imo cleaner and more readable * don't re-fetch pr branch, we want to test the version our pipeline is running on
This commit is contained in:
@@ -90,15 +90,13 @@ cargo-check-benches:
|
|||||||
- !reference [.rusty-cachier, before_script]
|
- !reference [.rusty-cachier, before_script]
|
||||||
- !reference [.pipeline-stopper-vars, script]
|
- !reference [.pipeline-stopper-vars, script]
|
||||||
# merges in the master branch on PRs
|
# merges in the master branch on PRs
|
||||||
- |
|
- 'if [ $CI_COMMIT_REF_NAME != "master" ]; then
|
||||||
export BASE=$(curl -s -H "Authorization: Bearer ${GITHUB_PR_TOKEN}" https://api.github.com/repos/paritytech/substrate/pulls/${CI_COMMIT_REF_NAME} | jq .base.ref)
|
BASE=$(curl -s -H "Authorization: Bearer ${GITHUB_PR_TOKEN}" https://api.github.com/repos/paritytech/substrate/pulls/${CI_COMMIT_REF_NAME} | jq -r .base.ref);
|
||||||
- if [ $CI_COMMIT_REF_NAME != "master" ]; then
|
printf "Merging base branch %s\n" "${BASE:=master}";
|
||||||
git fetch origin +${BASE}:${BASE};
|
|
||||||
git fetch origin +$CI_COMMIT_REF_NAME:$CI_COMMIT_REF_NAME;
|
|
||||||
git checkout ${BASE};
|
|
||||||
git config user.email "ci@gitlab.parity.io";
|
git config user.email "ci@gitlab.parity.io";
|
||||||
git merge $CI_COMMIT_REF_NAME --verbose --no-edit;
|
git fetch origin "refs/heads/${BASE}";
|
||||||
fi
|
git merge --verbose --no-edit FETCH_HEAD;
|
||||||
|
fi'
|
||||||
parallel: 2
|
parallel: 2
|
||||||
script:
|
script:
|
||||||
- rusty-cachier snapshot create
|
- rusty-cachier snapshot create
|
||||||
|
|||||||
Reference in New Issue
Block a user