Skip to content

Commit

Permalink
checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
wuwentao committed Jun 27, 2024
1 parent be3e1c3 commit 8506d6f
Showing 1 changed file with 18 additions and 38 deletions.
56 changes: 18 additions & 38 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,44 +42,6 @@ jobs:
image_md5: ${{ steps.save_tftp.outputs.image_md5 }}
image_path: ${{ steps.save_tftp.outputs.image_path }}
steps:
- name: Install node for action/checkout
id: install_node
run: |
set -x
PR_REPO=${{ github.event.pull_request.head.repo.full_name }}
PR_BRANCH=${{ github.event.pull_request.head.ref }}
BASE_REPO=${{ github.repository }}
BASE_BRANCH=${{ github.event.pull_request.base.ref }}
echo "PR_REPO: ${PR_REPO}, PR_BRANCH: ${PR_BRANCH}"
echo "BASE_REPO: ${BASE_REPO}, BASE_BRANCH: ${BASE_BRANCH}"
# cache from https://nodejs.org/en/download/prebuilt-binaries
pwd
whoami
ls -alht
sudo wget -q https://ai.b-bug.org/k230/test_resources/ci/packages/node-v20.15.0-linux-x64.tar.xz || exit 1
ls -alht
sudo mkdir /opt/node/ || exit 1
sudo tar -xf node-v20.15.0-linux-x64.tar.xz --strip-components=1 -C /opt/node/ || exit 1
sudo chmod -R 755 /opt/node || exit 1
ls /opt/node/bin/
echo "show version with path"
/opt/node/bin/node --version
sudo ln -s /opt/node/bin/node /opt/node/bin/node20
export NODEJS_HOME=/opt/node/bin
export PATH=$NODEJS_HOME:$PATH
echo "confirm version without path"
node --version || exit 1
npm --version
which node
which npm
set +x
- name: Checkout Source Code
uses: actions/checkout@v4
with:
fetch-depth: 0
clean: true

- name: Build Env Setup
id: build_env
run: |
Expand Down Expand Up @@ -108,6 +70,24 @@ jobs:
HW_MODEL=$(echo $CONF | awk -F "_" '{if ($3 == "v2") print $2"_"$3; else print $2}')
echo "HW_TYPE ${HW_TYPE}, HW_MODEL ${HW_MODEL}"
- name: Checkout Code
id: checkout_code
run: |
set -x
PR_REPO=${{ github.event.pull_request.head.repo.full_name }}
PR_BRANCH=${{ github.event.pull_request.head.ref }}
BASE_REPO=${{ github.repository }}
BASE_BRANCH=${{ github.event.pull_request.base.ref }}
echo "PR_REPO: ${PR_REPO}, PR_BRANCH: ${PR_BRANCH}"
echo "BASE_REPO: ${BASE_REPO}, BASE_BRANCH: ${BASE_BRANCH}"
echo "Cloning PR repository ${PR_REPO} branch ${PR_BRANCH}"
git clone --depth=0 --branch=${PR_BRANCH} https://github.com/${PR_REPO} /workspace || git clone --depth=0 --branch=${PR_BRANCH} https://github.com/${PR_REPO} /workspace
cd /workspace
git fetch origin ${PR_BRANCH}:${PR_BRANCH} || exit 1
git checkout ${PR_BRANCH} || exit 1
ls -alht
pwd
- name: Build Image
id: build_image
run: |
Expand Down

0 comments on commit 8506d6f

Please sign in to comment.