diff options
| author | Daniel Carosone <Daniel.Carosone@gmail.com> | 2020-10-07 09:22:38 +1100 |
|---|---|---|
| committer | Daniel Carosone <Daniel.Carosone@gmail.com> | 2020-10-07 09:22:38 +1100 |
| commit | f386cb63cb6d3cd6642debfb4dc1bde97b325550 (patch) | |
| tree | 30b21968997f809dbbba59117db93254607fa22d /.github | |
| parent | 3d6a0ea64fb2661ee1150a84425f50c18c2de9ad (diff) | |
| parent | b1e1abae29591e50ebf345a2bd249a73e564cea9 (diff) | |
Merge branch 'master'
of https://github.com/rtic-rs/cortex-m-rtic
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/build.yml | 163 |
1 files changed, 130 insertions, 33 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c687115..8da9867 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,7 +45,6 @@ jobs: - x86_64-unknown-linux-gnu toolchain: - stable - - 1.36.0 steps: - name: Checkout uses: actions/checkout@v2 @@ -79,10 +78,6 @@ jobs: target: ${{ matrix.target }} override: true - - name: Disable optimisation profiles - if: matrix.toolchain == '1.36.0' - run: sed -i '/^\[profile.*build-override]$/,/^$/{/^#/!{/^$/!d}}' Cargo.toml - - name: cargo check uses: actions-rs/cargo@v1 with: @@ -90,7 +85,7 @@ jobs: command: check args: --target=${{ matrix.target }} - # Verify all examples + # Verify all examples, checks checkexamples: name: checkexamples runs-on: ubuntu-20.04 @@ -145,6 +140,51 @@ jobs: command: check args: --examples --target=${{ matrix.target }} --features __min_r1_43,${{ env.V7 }} + # Verify the example output with run-pass tests + testexamples: + name: testexamples + runs-on: ubuntu-20.04 + strategy: + matrix: + target: + - thumbv7m-none-eabi + - thumbv6m-none-eabi + toolchain: + - stable + 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: Install Rust ${{ matrix.toolchain }} with target (${{ matrix.target }}) + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.toolchain }} + target: ${{ matrix.target }} + override: true + components: llvm-tools-preview + # Use precompiled binutils - name: cargo install cargo-binutils uses: actions-rs/install@v0.1 @@ -306,7 +346,6 @@ jobs: - x86_64-unknown-linux-gnu toolchain: - stable - - 1.36.0 steps: - name: Checkout uses: actions/checkout@v2 @@ -340,10 +379,6 @@ jobs: target: ${{ matrix.target }} override: true - - name: Disable optimisation profiles - if: matrix.toolchain == '1.36.0' - run: sed -i '/^\[profile.*build-override]$/,/^$/{/^#/!{/^$/!d}}' Cargo.toml - - name: cargo check uses: actions-rs/cargo@v1 with: @@ -351,6 +386,56 @@ jobs: command: check args: --manifest-path macros/Cargo.toml --target=${{ matrix.target }} + # Run the macros test-suite + testmacros: + name: testmacros + runs-on: ubuntu-20.04 + strategy: + matrix: + target: + - x86_64-unknown-linux-gnu + toolchain: + - stable + 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: Install Rust ${{ matrix.toolchain }} with target (${{ matrix.target }}) + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.toolchain }} + target: ${{ matrix.target }} + override: true + + - name: cargo check + uses: actions-rs/cargo@v1 + with: + use-cross: false + command: test + args: --manifest-path macros/Cargo.toml --target=${{ matrix.target }} + # Run test suite for thumbv7m testv7: name: testv7 @@ -382,13 +467,10 @@ jobs: - name: Install Rust uses: actions-rs/toolchain@v1 with: - toolchain: 1.36.0 + toolchain: stable target: thumbv7m-none-eabi override: true - - name: Disable optimisation profiles - run: sed -i '/^\[profile.*build-override]$/,/^$/{/^#/!{/^$/!d}}' Cargo.toml - - uses: actions-rs/cargo@v1 with: use-cross: false @@ -426,13 +508,10 @@ jobs: - name: Install Rust uses: actions-rs/toolchain@v1 with: - toolchain: 1.36.0 + toolchain: stable target: thumbv6m-none-eabi override: true - - name: Disable optimisation profiles - run: sed -i '/^\[profile.*build-override]$/,/^$/{/^#/!{/^$/!d}}' Cargo.toml - - uses: actions-rs/cargo@v1 with: use-cross: false @@ -529,7 +608,7 @@ jobs: - name: mdBook Action uses: peaceiris/actions-mdbook@v1.1.11 with: - mdbook-version: '0.3.1' + mdbook-version: 'latest' - name: Build book in English run: cd book/en && mdbook build @@ -557,7 +636,9 @@ jobs: - style - check - checkexamples + - testexamples - checkmacros + - testmacros - testv7 - testv6 - docs @@ -582,8 +663,7 @@ jobs: - name: mdBook Action uses: peaceiris/actions-mdbook@v1.1.11 with: - mdbook-version: '0.3.1' - # mdbook-version: 'latest' + mdbook-version: 'latest' - name: Remove cargo-config run: rm -f .cargo/config @@ -594,27 +674,37 @@ jobs: - name: Build books run: | langs=( en ru ) - latest=0.5 - vers=( 0.4.x ) + devver=( dev ) + # The latest stable must be the first element in the array + vers=( 0.5.x 0.4.x ) + + # All releases start with "v" + # followed by MAJOR.MINOR.PATCH, see semver.org + # Retain MAJOR.MINOR as $stable + stable=${vers%.*} + + echo "Stable version: $stable" # Create directories td=$(mktemp -d) - mkdir -p $td/$latest/book/ - cp -r target/doc $td/$latest/api + mkdir -p $td/$devver/book/ + cp -r target/doc $td/$devver/api + + # Redirect the main site to the stable release + sed "s|URL|$stable|g" redirect.html > $td/index.html - # sed fixes - sed 's|URL|rtic/index.html|g' redirect.html > $td/$latest/api/index.html - sed 's|URL|0.5|g' redirect.html > $td/index.html - sed 's|URL|book/en|g' redirect.html > $td/$latest/index.html + # Create the redirects for dev-version + sed 's|URL|rtic/index.html|g' redirect.html > $td/$devver/api/index.html + sed 's|URL|book/en|g' redirect.html > $td/$devver/index.html # Build books for lang in ${langs[@]}; do ( cd book/$lang && mdbook build ) - cp -r book/$lang/book $td/$latest/book/$lang - cp LICENSE-* $td/$latest/book/$lang/ + cp -r book/$lang/book $td/$devver/book/$lang + cp LICENSE-* $td/$devver/book/$lang/ done - # Build older versions + # Build older versions, including stable root=$(pwd) for ver in ${vers[@]}; do prefix=${ver%.*} @@ -639,6 +729,9 @@ jobs: rm -rf $src done + # Copy the stable book to the stable alias + cp -r $td/$stable $td/stable + # Forward CNAME file cp CNAME $td/ mv $td/ bookstodeploy @@ -660,7 +753,9 @@ jobs: - style - check - checkexamples + - testexamples - checkmacros + - testmacros - testv7 - testv6 - docs @@ -676,7 +771,9 @@ jobs: - style - check - checkexamples + - testexamples - checkmacros + - testmacros - testv7 - testv6 - docs |
