From 156f37765b38853e188c91fff2e667b9457de20a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Tue, 16 Jun 2020 06:56:51 +0000 Subject: [PATCH 1/7] Enable caching for Github Actions --- .github/workflows/build.yml | 225 +++++++++++++++++++++++++++++++++++- 1 file changed, 221 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3e5a90e55e..d2cebd0ad1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,6 +50,36 @@ jobs: - name: Checkout uses: actions/checkout@v2 + - name: Cache cargo dependencies + uses: actions/cache@v2 + with: + path: | + - ~/.cargo/bin/ + - ~/.cargo/registry/index/ + - ~/.cargo/registry/cache/ + - ~/.cargo/git/db/ + key: ${{ runner.OS }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.OS }}-cargo-${{ hashFiles('**/Cargo.lock') }} + ${{ runner.OS }}-cargo- + + - name: Cache build output dependencies + uses: actions/cache@v2 + with: + path: target + key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }} + ${{ runner.OS }}-build- + + - name: Cache Rust toolchain + uses: actions/cache@v2 + with: + path: /usr/share/rust/ + key: ${{ runner.OS }}-rust-${{ env.rustc_hash }} + restore-keys: | + ${{ runner.OS }}-rust-${{ env.rustc_hash }} + - name: Install Rust ${{ matrix.toolchain }} with target (${{ matrix.target }}) uses: actions-rs/toolchain@v1 with: @@ -83,6 +113,54 @@ jobs: - name: Checkout uses: actions/checkout@v2 + - name: Cache cargo dependencies + uses: actions/cache@v2 + with: + path: | + - ~/.cargo/bin/ + - ~/.cargo/registry/index/ + - ~/.cargo/registry/cache/ + - ~/.cargo/git/db/ + key: ${{ runner.OS }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.OS }}-cargo-${{ hashFiles('**/Cargo.lock') }} + ${{ runner.OS }}-cargo- + + - name: Cache build output dependencies + uses: actions/cache@v2 + with: + path: target + key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }} + ${{ runner.OS }}-build- + + - name: Cache Rust toolchain + uses: actions/cache@v2 + with: + path: /usr/share/rust/ + key: ${{ runner.OS }}-rust-${{ env.rustc_hash }} + restore-keys: | + ${{ runner.OS }}-rust-${{ env.rustc_hash }} + + - name: Cache QEMU binary + id: cache-qemu-binary + uses: actions/cache@v2 + with: + path: qemu + key: ${{ runner.OS }}-qemu + restore-keys: | + ${{ runner.OS }}-qemu + + - name: Cache arm-none-eabi-gcc + id: cache-arm-none-eabi-gcc + uses: actions/cache@v2 + with: + path: arm-none-eabi-gcc + key: ${{ runner.OS }}-gcc + restore-keys: | + ${{ runner.OS }}-gcc + - name: Install Rust ${{ matrix.toolchain }} with target (${{ matrix.target }}) uses: actions-rs/toolchain@v1 with: @@ -103,21 +181,35 @@ jobs: args: -p homogeneous --examples --target=${{ matrix.target }} - name: Install QEMU + if: steps.cache-qemu-binary.outputs.cache-hit != 'true' run: | - mkdir qemu - curl -L https://github.com/japaric/qemu-bin/raw/master/14.04/qemu-system-arm-2.12.0 > qemu/qemu-system-arm + mkdir -p qemu + curl -C - -L https://github.com/japaric/qemu-bin/raw/master/14.04/qemu-system-arm-2.12.0 > qemu/qemu-system-arm chmod +x qemu/qemu-system-arm + - name: Setup add QEMU to PATH + env: + GITHUB_WORKSPACE: ${{ github.workspace }} + run: echo "::add-path::${GITHUB_WORKSPACE}/qemu" + - name: Setup arm-none-eabi-gcc + if: steps.cache-arm-none-eabi-gcc.outputs.cache-hit != 'true' uses: fiam/arm-none-eabi-gcc@v1 with: + directory: 'arm-none-eabi-gcc' # Place it locally so it is possible to cache release: '9-2019-q4' # The arm-none-eabi-gcc release to use. + - name: Setup add arm-none-eabi-gcc to PATH + if: steps.cache-arm-none-eabi-gcc.outputs.cache-hit == 'true' + env: + GITHUB_WORKSPACE: ${{ github.workspace }} + run: echo "::add-path::${GITHUB_WORKSPACE}/arm-none-eabi-gcc/bin" + - name: Run-pass tests run: | - # Add QEMU to the path + # Print the path echo $PATH - PATH=$(pwd)/qemu:$PATH + #PATH=$(pwd)/qemu:$PATH arm_example() { local COMMAND=$1 local EXAMPLE=$2 @@ -267,6 +359,37 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + + - name: Cache cargo dependencies + uses: actions/cache@v2 + with: + path: | + - ~/.cargo/bin/ + - ~/.cargo/registry/index/ + - ~/.cargo/registry/cache/ + - ~/.cargo/git/db/ + key: ${{ runner.OS }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.OS }}-cargo-${{ hashFiles('**/Cargo.lock') }} + ${{ runner.OS }}-cargo- + + - name: Cache build output dependencies + uses: actions/cache@v2 + with: + path: target + key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }} + ${{ runner.OS }}-build- + + - name: Cache Rust toolchain + uses: actions/cache@v2 + with: + path: /usr/share/rust/ + key: ${{ runner.OS }}-rust-${{ env.rustc_hash }} + restore-keys: | + ${{ runner.OS }}-rust-${{ env.rustc_hash }} + - name: Install Rust ${{ matrix.toolchain }} with target (${{ matrix.target }}) uses: actions-rs/toolchain@v1 with: @@ -292,6 +415,35 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + + - name: Cache cargo dependencies + uses: actions/cache@v2 + with: + path: | + - ~/.cargo/bin/ + - ~/.cargo/registry/index/ + - ~/.cargo/registry/cache/ + - ~/.cargo/git/db/ + key: ${{ runner.OS }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.OS }}-cargo- + + - name: Cache build output dependencies + uses: actions/cache@v2 + with: + path: target + key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.OS }}-build- + + - name: Cache Rust toolchain + uses: actions/cache@v2 + with: + path: /usr/share/rust/ + key: ${{ runner.OS }}-rust-${{ env.rustc_hash }} + restore-keys: | + ${{ runner.OS }}-rust-${{ env.rustc_hash }} + - name: Install Rust uses: actions-rs/toolchain@v1 with: @@ -315,6 +467,35 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + + - name: Cache cargo dependencies + uses: actions/cache@v2 + with: + path: | + - ~/.cargo/bin/ + - ~/.cargo/registry/index/ + - ~/.cargo/registry/cache/ + - ~/.cargo/git/db/ + key: ${{ runner.OS }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.OS }}-cargo- + + - name: Cache build output dependencies + uses: actions/cache@v2 + with: + path: target + key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.OS }}-build- + + - name: Cache Rust toolchain + uses: actions/cache@v2 + with: + path: /usr/share/rust/ + key: ${{ runner.OS }}-rust-${{ env.rustc_hash }} + restore-keys: | + ${{ runner.OS }}-rust-${{ env.rustc_hash }} + - name: Install Rust uses: actions-rs/toolchain@v1 with: @@ -391,6 +572,42 @@ jobs: - name: Checkout uses: actions/checkout@v2 + - name: Cache cargo dependencies + uses: actions/cache@v2 + with: + path: | + - ~/.cargo/bin/ + - ~/.cargo/registry/index/ + - ~/.cargo/registry/cache/ + - ~/.cargo/git/db/ + key: ${{ runner.OS }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.OS }}-cargo- + + - name: Cache build output dependencies + uses: actions/cache@v2 + with: + path: target + key: ${{ runner.OS }}-build-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.OS }}-build- + + - name: Cache Rust toolchain + uses: actions/cache@v2 + with: + path: /usr/share/rust/ + key: ${{ runner.OS }}-rust-${{ env.rustc_hash }} + restore-keys: | + ${{ runner.OS }}-rust-${{ env.rustc_hash }} + + - name: Cache pip installed linkchecker + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip + restore-keys: | + ${{ runner.os }}-pip- + - name: Set up Python 3.x uses: actions/setup-python@v2 with: From 71677b3170a33b1016e91cc06c79bb1f752877dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Tue, 14 Jul 2020 15:48:59 +0000 Subject: [PATCH 2/7] Remove old PATH modification just to trigger re-run of CI --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d2cebd0ad1..880bfa1236 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -209,7 +209,7 @@ jobs: run: | # Print the path echo $PATH - #PATH=$(pwd)/qemu:$PATH + arm_example() { local COMMAND=$1 local EXAMPLE=$2 From 82220d21f79dc15d580e557a5bb04a152e2e6f3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Thu, 23 Jul 2020 16:56:41 +0000 Subject: [PATCH 3/7] Try running with cargo-binutils --- .github/workflows/build.yml | 39 ++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 880bfa1236..f9d87daccd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -167,6 +167,7 @@ jobs: toolchain: ${{ matrix.toolchain }} target: ${{ matrix.target }} override: true + components: llvm-tools-preview - uses: actions-rs/cargo@v1 with: use-cross: false @@ -180,6 +181,13 @@ jobs: command: check args: -p homogeneous --examples --target=${{ matrix.target }} + - name: cargo install cargo-binutils + uses: actions-rs/install@v0.1 + with: + crate: cargo-binutils + version: latest + use-tool-cache: true + - name: Install QEMU if: steps.cache-qemu-binary.outputs.cache-hit != 'true' run: | @@ -192,18 +200,18 @@ jobs: GITHUB_WORKSPACE: ${{ github.workspace }} run: echo "::add-path::${GITHUB_WORKSPACE}/qemu" - - name: Setup arm-none-eabi-gcc - if: steps.cache-arm-none-eabi-gcc.outputs.cache-hit != 'true' - uses: fiam/arm-none-eabi-gcc@v1 - with: - directory: 'arm-none-eabi-gcc' # Place it locally so it is possible to cache - release: '9-2019-q4' # The arm-none-eabi-gcc release to use. + #- name: Setup arm-none-eabi-gcc + #if: steps.cache-arm-none-eabi-gcc.outputs.cache-hit != 'true' + #uses: fiam/arm-none-eabi-gcc@v1 + #with: + #directory: 'arm-none-eabi-gcc' # Place it locally so it is possible to cache + #release: '9-2019-q4' # The arm-none-eabi-gcc release to use. - - name: Setup add arm-none-eabi-gcc to PATH - if: steps.cache-arm-none-eabi-gcc.outputs.cache-hit == 'true' - env: - GITHUB_WORKSPACE: ${{ github.workspace }} - run: echo "::add-path::${GITHUB_WORKSPACE}/arm-none-eabi-gcc/bin" + #- name: Setup add arm-none-eabi-gcc to PATH + #if: steps.cache-arm-none-eabi-gcc.outputs.cache-hit == 'true' + #env: + #GITHUB_WORKSPACE: ${{ github.workspace }} + #run: echo "::add-path::${GITHUB_WORKSPACE}/arm-none-eabi-gcc/bin" - name: Run-pass tests run: | @@ -237,7 +245,8 @@ jobs: else cargo $COMMAND $CARGO_FLAGS fi - arm-none-eabi-objcopy -O ihex target/${{ matrix.target }}/$BUILD_MODE/examples/$EXAMPLE ci/builds/${EXAMPLE}_${FEATURES_STR}${BUILD_MODE}_${BUILD_NUM}.hex + #arm-none-eabi-objcopy -O ihex target/${{ matrix.target }}/$BUILD_MODE/examples/$EXAMPLE ci/builds/${EXAMPLE}_${FEATURES_STR}${BUILD_MODE}_${BUILD_NUM}.hex + cargo objcopy $CARGO_FLAGS -- -O ihex ci/builds/${EXAMPLE}_${FEATURES_STR}${BUILD_MODE}_${BUILD_NUM}.hex } mkdir -p ci/builds @@ -282,15 +291,13 @@ jobs: $td/pool.run grep 'foo(0x2' $td/pool.run grep 'bar(0x2' $td/pool.run - arm-none-eabi-objcopy -O ihex target/${{ matrix.target }}/debug/examples/$ex \ - ci/builds/${ex}___v7_debug_1.hex + cargo objcopy --example $ex --target ${{ matrix.target }} --features __v7 -- -O ihex ci/builds/${ex}___v7_debug_1.hex cargo run --example $ex --target ${{ matrix.target }} --features __v7 --release >\ $td/pool.run grep 'foo(0x2' $td/pool.run grep 'bar(0x2' $td/pool.run - arm-none-eabi-objcopy -O ihex target/${{ matrix.target }}/release/examples/$ex \ - ci/builds/${ex}___v7_release_1.hex + cargo objcopy --example $ex --target ${{ matrix.target }} --features __v7 --release -- -O ihex ci/builds/${ex}___v7_release_1.hex rm -rf $td From 2bde8af2144716ea21df28359cdd4d91de98fc2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Sat, 25 Jul 2020 22:10:59 +0000 Subject: [PATCH 4/7] Remove arm-none-eabi-gcc --- .github/workflows/build.yml | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f9d87daccd..8f0eb87aa3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -152,15 +152,6 @@ jobs: restore-keys: | ${{ runner.OS }}-qemu - - name: Cache arm-none-eabi-gcc - id: cache-arm-none-eabi-gcc - uses: actions/cache@v2 - with: - path: arm-none-eabi-gcc - key: ${{ runner.OS }}-gcc - restore-keys: | - ${{ runner.OS }}-gcc - - name: Install Rust ${{ matrix.toolchain }} with target (${{ matrix.target }}) uses: actions-rs/toolchain@v1 with: @@ -200,19 +191,6 @@ jobs: GITHUB_WORKSPACE: ${{ github.workspace }} run: echo "::add-path::${GITHUB_WORKSPACE}/qemu" - #- name: Setup arm-none-eabi-gcc - #if: steps.cache-arm-none-eabi-gcc.outputs.cache-hit != 'true' - #uses: fiam/arm-none-eabi-gcc@v1 - #with: - #directory: 'arm-none-eabi-gcc' # Place it locally so it is possible to cache - #release: '9-2019-q4' # The arm-none-eabi-gcc release to use. - - #- name: Setup add arm-none-eabi-gcc to PATH - #if: steps.cache-arm-none-eabi-gcc.outputs.cache-hit == 'true' - #env: - #GITHUB_WORKSPACE: ${{ github.workspace }} - #run: echo "::add-path::${GITHUB_WORKSPACE}/arm-none-eabi-gcc/bin" - - name: Run-pass tests run: | # Print the path @@ -245,7 +223,6 @@ jobs: else cargo $COMMAND $CARGO_FLAGS fi - #arm-none-eabi-objcopy -O ihex target/${{ matrix.target }}/$BUILD_MODE/examples/$EXAMPLE ci/builds/${EXAMPLE}_${FEATURES_STR}${BUILD_MODE}_${BUILD_NUM}.hex cargo objcopy $CARGO_FLAGS -- -O ihex ci/builds/${EXAMPLE}_${FEATURES_STR}${BUILD_MODE}_${BUILD_NUM}.hex } From 6df6db40d8c48192c433555e525b2f8f0b997ed5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Sat, 25 Jul 2020 22:37:08 +0000 Subject: [PATCH 5/7] Trigger CI rerun --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8f0eb87aa3..9a3b23b800 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -172,6 +172,7 @@ jobs: command: check args: -p homogeneous --examples --target=${{ matrix.target }} + # Use precompiled binutils - name: cargo install cargo-binutils uses: actions-rs/install@v0.1 with: From 5a23fb3bd3ac55896f8aa6a57ace3a550202dcf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Mon, 24 Aug 2020 11:51:21 +0000 Subject: [PATCH 6/7] Use ubuntu-20.04 (actual latest) --- .github/workflows/build.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9a3b23b800..e19fda4b7f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: # Run cargo fmt --check, includes macros/ style: name: style - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Checkout uses: actions/checkout@v1 @@ -36,7 +36,7 @@ jobs: # Compilation check check: name: check - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 strategy: matrix: target: @@ -101,7 +101,7 @@ jobs: # Verify all examples checkexamples: name: checkexamples - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 strategy: matrix: target: @@ -333,7 +333,7 @@ jobs: # Check the correctness of macros/ crate checkmacros: name: checkmacros - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 strategy: matrix: target: @@ -396,7 +396,7 @@ jobs: # Run test suite for thumbv7m testv7: name: testv7 - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Checkout uses: actions/checkout@v2 @@ -448,7 +448,7 @@ jobs: # Run test suite for thumbv6m testv6: name: testv6 - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Checkout uses: actions/checkout@v2 @@ -500,7 +500,7 @@ jobs: # Verify all multicore examples checkmulticore: name: checkmulticore - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 strategy: matrix: target: @@ -551,7 +551,7 @@ jobs: # Build documentation, check links docs: name: docs - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Checkout @@ -624,7 +624,7 @@ jobs: # Build the books mdbook: name: mdbook - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Checkout uses: actions/checkout@v2 @@ -669,7 +669,7 @@ jobs: # Only runs when pushing to master branch deploy: name: deploy - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 needs: - style - check @@ -784,7 +784,7 @@ jobs: - checkmulticore - docs - mdbook - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Mark the job as a success run: exit 0 @@ -801,7 +801,7 @@ jobs: - checkmulticore - docs - mdbook - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - name: Mark the job as a failure run: exit 1 From 877d9458706bf0d4ee139ad41c586640911a0447 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Tj=C3=A4der?= Date: Mon, 24 Aug 2020 11:57:53 +0000 Subject: [PATCH 7/7] Try system QEMU --- .github/workflows/build.yml | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e19fda4b7f..0ec72bb1cb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -143,15 +143,6 @@ jobs: restore-keys: | ${{ runner.OS }}-rust-${{ env.rustc_hash }} - - name: Cache QEMU binary - id: cache-qemu-binary - uses: actions/cache@v2 - with: - path: qemu - key: ${{ runner.OS }}-qemu - restore-keys: | - ${{ runner.OS }}-qemu - - name: Install Rust ${{ matrix.toolchain }} with target (${{ matrix.target }}) uses: actions-rs/toolchain@v1 with: @@ -181,16 +172,9 @@ jobs: use-tool-cache: true - name: Install QEMU - if: steps.cache-qemu-binary.outputs.cache-hit != 'true' run: | - mkdir -p qemu - curl -C - -L https://github.com/japaric/qemu-bin/raw/master/14.04/qemu-system-arm-2.12.0 > qemu/qemu-system-arm - chmod +x qemu/qemu-system-arm - - - name: Setup add QEMU to PATH - env: - GITHUB_WORKSPACE: ${{ github.workspace }} - run: echo "::add-path::${GITHUB_WORKSPACE}/qemu" + sudo apt update + sudo apt install -y qemu-system-arm - name: Run-pass tests run: |