Skip to content

Commit

Permalink
fix cache workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
gtxaspec committed Mar 1, 2024
1 parent d486cfb commit 950044e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 29 deletions.
42 changes: 15 additions & 27 deletions .github/workflows/build-cache-1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,16 @@ jobs:
HTTP=$(curl ${TG_OPTIONS} -H "Content-Type: multipart/form-data" -X POST https://api.telegram.org/bot${TG_TOKEN}/sendMessage -F parse_mode=MarkdownV2 -F chat_id=${TG_CHANNEL} -F text="${TG_HEADER}" -F disable_web_page_preview=true)
echo Telegram response: ${HTTP}
build-caches:
name: buildroot-cache-genration
build-toolchain:
name: ${{ matrix.toolchain-version }}
needs: notify-begin
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain-version:
- build_cache

steps:
- name: Calculate current week number
id: date
Expand Down Expand Up @@ -81,7 +87,7 @@ jobs:
run: |
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests libc6=2.37-0ubuntu2 libc-bin=2.37-0ubuntu2 libc6-mipsel-cross=2.37-0ubuntu1cross1 libc6-dev=2.37-0ubuntu2 libc-dev-bin=2.37-0ubuntu2 coreutils=9.1-1ubuntu2 libgmp10=2:6.2.1+dfsg1-1.1ubuntu1
- name: Setup build env
- name: Build firmware cache
run: |
export GIT_HASH=$(git rev-parse --short ${GITHUB_SHA})
export GIT_BRANCH=${GITHUB_REF_NAME}
Expand All @@ -93,35 +99,16 @@ jobs:
ln -s /tmp/ccache ${HOME}/.ccache
ln -s /tmp/dl ${HOME}/dl
- name: Build cache - build_cache
run: |
BOARD=build_cache make
- name: Build cache - toolchain_xburst1_musl_gcc13
run: |
BOARD=toolchain_xburst1_musl_gcc13 make
- name: Build cache - toolchain_xburst1_musl_gcc12
run: |
BOARD=toolchain_xburst1_musl_gcc12 make
BOARD=${{ matrix.toolchain-version }} make
- name: Build cache - toolchain_xburst1_gnu_gcc13
run: |
BOARD=toolchain_xburst1_gnu_gcc13 make
- name: Build cache - toolchain_xburst1_gnu_gcc12
run: |
BOARD=toolchain_xburst1_gnu_gcc12 make
- name: finalize build time
run: |
TIME=$(date -d @${SECONDS} +%M:%S)
echo "TIME=${TIME}" >> ${GITHUB_ENV}
- name: Send completion notification with job link
if: github.event_name != 'pull_request' && env.INGTC && env.TG_ENABLE== 'true'
run: |
TG_MSG="build-caches\nCommit: [${GIT_HASH}](https://github.com/${GITHUB_REPOSITORY}/commit/${GIT_HASH})\nBranch: [${GIT_BRANCH}](https://github.com/${GITHUB_REPOSITORY}/tree/${GIT_BRANCH})\nTag: [${TAG_NAME}](https://github.com/${GITHUB_REPOSITORY}/releases/tag/${TAG_NAME})\nTime: ${TIME}\nJob: [${{ github.run_id }}](https://github.com/${GITHUB_REPOSITORY}/actions/runs/${{ github.run_id }})\n\n"
TG_ESCAPED_VERSION=$(echo "${{ matrix.toolchain-version }}" | sed 's/_/\\_/g')
TG_MSG="${TG_ESCAPED_VERSION}\nCommit: [${GIT_HASH}](https://github.com/${GITHUB_REPOSITORY}/commit/${GIT_HASH})\nBranch: [${GIT_BRANCH}](https://github.com/${GITHUB_REPOSITORY}/tree/${GIT_BRANCH})\nTag: [${TAG_NAME}](https://github.com/${GITHUB_REPOSITORY}/releases/tag/${TAG_NAME})\nTime: ${TIME}\nJob: [${{ github.run_id }}](https://github.com/${GITHUB_REPOSITORY}/actions/runs/${{ github.run_id }})\n\n"
TG_ICON="\xE2\x9C\x85 GitHub Actions"
TG_HEADER=$(echo -e "${TG_MSG}${TG_ICON}")
HTTP=$(curl ${TG_OPTIONS} -H "Content-Type: multipart/form-data" -X POST https://api.telegram.org/bot${TG_TOKEN}/sendMessage -F parse_mode=MarkdownV2 -F chat_id=${TG_CHANNEL} -F text="${TG_HEADER}" -F disable_web_page_preview=true)
Expand All @@ -131,15 +118,16 @@ jobs:
- name: Send error notification
if: github.event_name != 'pull_request' && failure()
run: |
TG_WARN="Error: build-caches\n"
TG_ESCAPED_VERSION=$(echo "${{ matrix.toolchain-version }}" | sed 's/_/\\_/g')
TG_WARN="Error: ${TG_ESCAPED_VERSION}\n"
TG_MSG="Commit: [${GIT_HASH}](https://github.com/${GITHUB_REPOSITORY}/commit/${GIT_HASH})\nBranch: [${GIT_BRANCH}](https://github.com/${GITHUB_REPOSITORY}/tree/${GIT_BRANCH})\nTag: [${TAG_NAME}](https://github.com/${GITHUB_REPOSITORY}/releases/tag/${TAG_NAME})\nJob: [${{ github.run_id }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})\n\n"
TG_ICON="\xE2\x9A\xA0 GitHub Actions"
TG_HEADER=$(echo -e ${TG_WARN}${TG_MSG}${TG_ICON})
HTTP=$(curl ${TG_OPTIONS} -H "Content-Type: multipart/form-data" -X POST https://api.telegram.org/bot${TG_TOKEN}/sendMessage -F parse_mode=MarkdownV2 -F chat_id=${TG_CHANNEL} -F text="${TG_HEADER}" -F disable_web_page_preview=true)
echo Telegram response: ${HTTP}
notify-completion:
needs: [build-caches, notify-begin]
needs: [build-toolchain, notify-begin]
runs-on: ubuntu-latest
if: always()
steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/toolchain.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ jobs:
if: always()
with:
path: /tmp/dl
key: ${{ runner.os }}-toolchain-shared-v1-${{ env.CURRENT_YEAR }}-week-${{ env.WEEK_NUMBER }}
key: ${{ runner.os }}-dl-shared-v1-${{ env.CURRENT_YEAR }}-week-${{ env.WEEK_NUMBER }}
restore-keys: |
${{ runner.os }}-toolchain-shared-v1-${{ env.CURRENT_YEAR }}-week-
${{ runner.os }}-dl-shared-v1-${{ env.CURRENT_YEAR }}-week-
- name: Setup repo sources for GCC13
run: |
Expand Down

0 comments on commit 950044e

Please sign in to comment.