cache-toolchain.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. name: Reusable workflow example
  2. on: workflow_call
  3. jobs:
  4. build:
  5. runs-on: ubuntu-latest
  6. steps:
  7. - uses: actions/checkout@v3
  8. - name: Cache build tools
  9. id: cache-build-tools
  10. uses: actions/cache@v3
  11. env:
  12. cache-name: cache-build-tools
  13. dadk_version: 0.1.2
  14. with:
  15. path: |
  16. ~/.cargo
  17. ~/.rustup
  18. ~/.bashrc
  19. key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.dadk_version }}-${{ hashFiles('.github/workflows/cache-toolchain.yml') }}
  20. - if: ${{ steps.cache-build-tools.outputs.cache-hit != 'true' }}
  21. name: Install toolchain
  22. continue-on-error: true
  23. run: |
  24. sudo sh -c "apt update && apt install -y llvm-dev libclang-dev clang gcc-multilib libssl-dev pkg-config"
  25. cargo install cargo-binutils
  26. rustup toolchain install nightly
  27. rustup default nightly
  28. rustup component add rust-src
  29. rustup component add llvm-tools-preview
  30. rustup target add x86_64-unknown-none
  31. rustup component add rust-src --toolchain nightly-2023-08-15-x86_64-unknown-linux-gnu
  32. rustup component add rustfmt
  33. cargo install dadk --version 0.1.2