Skip to content

Commit

Permalink
[gha] fix up rustdoc for consistence & correct trigger. Fix up lint t…
Browse files Browse the repository at this point in the history
…o not rerun on bors land.

Closes: aptos-labs#8967
  • Loading branch information
rexhoffman authored and bors-libra committed Aug 18, 2021
1 parent 7b16220 commit 5497183
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/ci-post-land.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ jobs:

update-sccache-ubuntu:
needs: prepare
if: ${{ needs.prepare.outputs.rust-changes == 'true' }}
environment:
name: Sccache
runs-on: ubuntu-latest-xl
container:
image: diem/build_environment:${{ needs.prepare.outputs.changes-target-branch }}
volumes:
- "${{github.workspace}}:/opt/git/diem"
if: ${{ needs.prepare.outputs.rust-changes == 'true' }}
steps:
- uses: actions/[email protected]
with:
Expand Down Expand Up @@ -329,31 +329,31 @@ jobs:
rustdoc:
needs: prepare
if: ${{ needs.prepare.output.changes-target-branch == 'main' }}
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: -D warnings
if: ${{ needs.prepare.outputs.changes-target-branch == 'main' && needs.prepare.outputs.rust-changes == 'true'}}
runs-on: ubuntu-latest

container:
image: diem/build_environment:${{ needs.prepare.outputs.changes-target-branch }}
volumes:
- "${{github.workspace}}:/opt/git/diem"
steps:
- name: Checkout repository
uses: actions/[email protected]

- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
- uses: ./.github/actions/build-setup
- uses: actions/[email protected]
with:
toolchain: stable
override: true

# Build the rust crate docs
# Use `RUSTC_BOOTSTRAP` in order to use the `--enable-index-page` flag of rustdoc
# This is needed in order to generate a landing page `index.html` for workspaces
path: "/opt/cargo/git\n/opt/cargo/registry\n/opt/cargo/.package-cache"
key: crates-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}
restore-keys: "crates-${{ runner.os }}"
- name: Build Documentation
# Build the rust crate docs
# Use `RUSTC_BOOTSTRAP` in order to use the `--enable-index-page` flag of rustdoc
# This is needed in order to generate a landing page `index.html` for workspaces
run: cargo doc --no-deps --workspace --lib
env:
RUSTC_BOOTSTRAP: 1
RUSTDOCFLAGS: "-Z unstable-options --enable-index-page"

CARGO_INCREMENTAL: 0
RUSTFLAGS: -D warnings
- name: Deploy Docs
uses: peaceiris/[email protected]
with:
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
changes-base-githash: ${{ steps.changes.outputs.changes-base-githash }}
changes-pull-request-number: ${{ steps.changes.outputs.changes-pull-request-number }}
build-images: ${{ steps.need-build-images.outputs.changes-found }}
any-changes-founds: ${{ steps.any-changes-found.outputs.changes-found }}
need-base-images: ${{ steps.need-base-images.outputs.need-extra }}
test-land-blocking: ${{ steps.need-land-blocking-test.outputs.need-lbt }}
test-compatibility: ${{ steps.need-compat-tests.outputs.need-compat }}
Expand Down Expand Up @@ -94,15 +95,14 @@ jobs:
echo "compatibility suite is enabled."
fi
echo "::set-output name=need-compat::$(echo $res)";
- id: environment
name: Which environment should we use for secrets.
- id: any-changes-found
name: determine if there are any files listed in the CHANGES_CHANGED_FILE_OUTPUTFILE.
run: |
output=None
if ${{ github.event_name == 'push' }}; then
echo "will use sccache environment for rust builds";
output=Sccache
res=true
if [[ ! -f "$CHANGES_CHANGED_FILE_OUTPUTFILE" ]] || [[ "$(cat "$CHANGES_CHANGED_FILE_OUTPUTFILE" | wc -l)" == 0 ]]; then
res=false;
fi
echo "::set-output name=name::$(echo $output)";
echo "::set-output name=changes-found::$(echo $res)";
- id: rust-changes
name: find rust/cargo changes.
uses: diem/actions/matches@faadd16607b77dfa2231a8f366883e01717b3225
Expand Down Expand Up @@ -497,7 +497,7 @@ jobs:
runs-on: ubuntu-latest-xl
timeout-minutes: 30
needs: prepare
#if: ${{ needs.prepare.outputs.test-rust == 'true' }}
if: ${{ needs.prepare.outputs.any-changes-founds == 'true' }}
container:
image: diem/build_environment:${{ needs.prepare.outputs.changes-target-branch }}
volumes:
Expand Down

0 comments on commit 5497183

Please sign in to comment.