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