Skip to content

Improve logging in README tests (#2222) #1179

Improve logging in README tests (#2222)

Improve logging in README tests (#2222) #1179

Workflow file for this run

name: Documentation
on:
push:
branches: [ main ]
paths-ignore:
- '*.md'
- 'docker/**'
- 'docker_scylla/**'
- 'configuration/**'
- 'kubernetes/**'
- 'scripts/**'
workflow_dispatch:
# This allows a subsequently queued workflow run to interrupt previous runs on pull-requests
concurrency:
group: '${{ github.workflow }} ${{ github.ref }}'
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUST_BACKTRACE: short
RUSTFLAGS: "-D warnings"
RUSTUP_MAX_RETRIES: 10
LINERA_PACKAGES: "packages.txt"
permissions:
contents: read
jobs:
publish-docs:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Compute docs
run: |
cargo doc --all-features
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_branch: gh-pages
publish_dir: ./target/doc
force_orphan: true
test-crates-and-docrs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install cargo tools
run: |
cargo install cargo-index
cargo install cargo-local-registry
- name: Setup git committer information
run: |
git config --global user.email "ci@linera.io"
git config --global user.name "CI"
- name: Generate packages
run: |
scripts/test_publish.sh "$LINERA_PACKAGES" ${{ runner.temp }}/registry
- name: Extract packaged crates
run: |
cd "${{ runner.temp }}/registry"
grep -v '^#' "$LINERA_PACKAGES" | while read LINE; do
CRATE="${LINE%% *}"
tar -xzvf "${CRATE}-*.crate"
done
- name: Checkout docs.rs tool repository
run: |
cd ${{ runner.temp }}
git clone https://github.com/rust-lang/docs.rs docsrs
cd docsrs
git submodule update --init
- name: Build documentation using docs.rs
run: |
cd ${{ runner.temp }}/docsrs
cp .env.sample .env
mkdir -p ignored/cratesfyi-prefix/crates.io-index
. .env
SQLX_OFFLINE=1 cargo build
docker-compose up -d db s3
cargo run -- database migrate
grep -v ^# "$LINERA_PACKAGES" | while read LINE; do
CRATE="${LINE%% *}"
cargo run -- build crate --local "${{ runner.temp }}/registry/${CRATE}-*/"
done