ci: prevent error if rust build is cached by nx (#4951)

If Rust build was cached by nx, only the output file will be presented. The chmod command will be failed in this case like: https://github.com/toeverything/AFFiNE/actions/runs/6874496337/job/18697360212
This commit is contained in:
LongYinan 2023-11-16 10:31:51 +08:00
parent 791eb75ca8
commit 703fad6a0d
No known key found for this signature in database
GPG Key ID: C3666B7FC82ADAD7

View File

@ -51,8 +51,12 @@ runs:
export CC_x86_64_unknown_linux_gnu=x86_64-unknown-linux-gnu-gcc export CC_x86_64_unknown_linux_gnu=x86_64-unknown-linux-gnu-gcc
export RUSTFLAGS="-C debuginfo=1" export RUSTFLAGS="-C debuginfo=1"
yarn workspace ${{ inputs.package }} nx build ${{ inputs.package }} --target ${{ inputs.target }} yarn workspace ${{ inputs.package }} nx build ${{ inputs.package }} --target ${{ inputs.target }}
chmod -R 777 node_modules/.cache if [ -d "node_modules/.cache" ]; then
chmod -R 777 target chmod -R 777 node_modules/.cache
fi
if [ -d "target" ]; then
chmod -R 777 target;
fi
- name: Build - name: Build
if: ${{ inputs.target == 'aarch64-unknown-linux-gnu' }} if: ${{ inputs.target == 'aarch64-unknown-linux-gnu' }}
@ -63,5 +67,9 @@ runs:
run: | run: |
export RUSTFLAGS="-C debuginfo=1" export RUSTFLAGS="-C debuginfo=1"
yarn workspace ${{ inputs.package }} nx build ${{ inputs.package }} --target ${{ inputs.target }} yarn workspace ${{ inputs.package }} nx build ${{ inputs.package }} --target ${{ inputs.target }}
chmod -R 777 node_modules/.cache if [ -d "node_modules/.cache" ]; then
chmod -R 777 target chmod -R 777 node_modules/.cache
fi
if [ -d "target" ]; then
chmod -R 777 target;
fi