Skip to content

Commit

Permalink
prevent generating docs / checking syntax and builds
Browse files Browse the repository at this point in the history
  • Loading branch information
wojciechsromek committed Jan 21, 2025
1 parent 93fff0f commit 17d0b61
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/build-all-targets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,91 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Get all test, doc and src files that have changed
id: changed-files-yaml
uses: tj-actions/changed-files@v45
with:
files_yaml: |
docs:
- '**.md'
adr:
- adr/**
config:
- certs/**
- deploy/**
- scripts/**
src:
- iris-*/**
# The following steps will only run if any of the src files have changed
- name: Install Dependencies
if: steps.changed-files-yaml.outputs.src_any_changed == 'true'
run: sudo apt install protobuf-compiler

- name: Cache build products
if: steps.changed-files-yaml.outputs.src_any_changed == 'true'
uses: Swatinem/[email protected]
with:
# Split the test and bench caches, the have different debug settings
key: "test"

- name: Install Rust nightly
if: steps.changed-files-yaml.outputs.src_any_changed == 'true'
run: rustup toolchain install nightly-2024-07-10

- name: Set Rust nightly as default
if: steps.changed-files-yaml.outputs.src_any_changed == 'true'
run: rustup default nightly-2024-07-10

# Building tests in release mode checks warnings and compiler errors that depend on optimisations
- name: Build Tests
if: steps.changed-files-yaml.outputs.src_any_changed == 'true'
run: cargo build --release --all-features --tests

build-bins:
runs-on:
labels: ubuntu-22.04-64core
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Get all test, doc and src files that have changed
id: changed-files-yaml
uses: tj-actions/changed-files@v45
with:
files_yaml: |
docs:
- '**.md'
adr:
- adr/**
config:
- certs/**
- deploy/**
- scripts/**
src:
- iris-*/**
# The following steps will only run if any of the src files have changed
- name: Install Dependencies
if: steps.changed-files-yaml.outputs.src_any_changed == 'true'
run: sudo apt install protobuf-compiler

- name: Cache build products
if: steps.changed-files-yaml.outputs.src_any_changed == 'true'
uses: Swatinem/[email protected]
with:
# Split the test and bench caches, they have different debug settings
key: "bench"

- name: Install Rust nightly
if: steps.changed-files-yaml.outputs.src_any_changed == 'true'
run: rustup toolchain install nightly-2024-07-10

- name: Set Rust nightly as default
if: steps.changed-files-yaml.outputs.src_any_changed == 'true'
run: rustup default nightly-2024-07-10

- name: Build All Targets
if: steps.changed-files-yaml.outputs.src_any_changed == 'true'
run: cargo build --release --all-features --lib --bins --benches --examples
27 changes: 27 additions & 0 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,40 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Get all test, doc and src files that have changed
id: changed-files-yaml
uses: tj-actions/changed-files@v45
with:
files_yaml: |
docs:
- '**.md'
adr:
- adr/**
config:
- certs/**
- deploy/**
- scripts/**
src:
- iris-*/**
# The following steps will only run if any of the src files have changed
- name: Install Dependencies
if: steps.changed-files-yaml.outputs.src_any_changed == 'true'
run: sudo apt install protobuf-compiler

- name: Show errors inline
if: steps.changed-files-yaml.outputs.src_any_changed == 'true'
uses: r7kamura/rust-problem-matchers@v1

- name: Install Rust nightly
if: steps.changed-files-yaml.outputs.src_any_changed == 'true'
run: rustup toolchain install nightly-2024-07-10

- name: Set Rust nightly as default
if: steps.changed-files-yaml.outputs.src_any_changed == 'true'
run: rustup default nightly-2024-07-10

- name: Build Docs
if: steps.changed-files-yaml.outputs.src_any_changed == 'true'
run: cargo doc --all-features --no-deps --document-private-items

0 comments on commit 17d0b61

Please sign in to comment.