Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions .github/workflows/rust-artifact.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ name: Rust Artifact
on:
workflow_call:
inputs:
rust_root:
description: Root of the rust code tree. May be a relative path.
type: string
required: false
build_matrix_build_args:
description: "Matrix args for the `cargo build` called in the job. Defaults to nothing, mostly useful in includes."
required: false
Expand Down Expand Up @@ -66,14 +62,6 @@ jobs:
include: ${{ fromJSON(inputs.matrix_include) }}
steps:
- uses: actions/checkout@v6
- id: rust_root
run: |
if [ -n "${{ inputs.rust_root }}" ] ; then
root="${{ inputs.rust_root }}"
else
root="${{ github.workspace }}"
fi
echo "rust_root=$root" >> $GITHUB_OUTPUT
- name: Install additional dependencies
if: ${{ inputs.additional_system_deps != '' }}
run: |
Expand Down Expand Up @@ -105,13 +93,12 @@ jobs:
# Make the target directory the same as the when `rust_target` is empty
echo "TARGET_DIR=./target" >> $GITHUB_ENV
- run: ${{inputs.cargo_command_env_vars}} cargo build ${{ matrix.build_args }} --profile ${{ inputs.build_profile }}
working-directory: ${{ steps.rust_root.outputs.rust_root }}
- uses: actions/upload-artifact@v7
with:
name: ${{ join(matrix.os) }}-${{ matrix.rust_target }}
path: |
${{ steps.rust_root.outputs.rust_root }}/target/${{ inputs.build_profile }}/*.dylib
${{ steps.rust_root.outputs.rust_root }}/target/${{ inputs.build_profile }}/*.so
target/${{ inputs.build_profile }}/*.dylib
target/${{ inputs.build_profile }}/*.so
if-no-files-found: error
- name: Print sccache stats
if: env.SCCACHE_AWS_SECRET != ''
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/rust-cargo-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ name: Rust Cargo Update
on:
workflow_call:
inputs:
rust_root:
description: Root of the rust code tree. May be a relative path.
type: string
required: false
reviewer:
description: GitHub username to set as PR reviewer. Falls back to github.actor if not set.
type: string
Expand All @@ -27,7 +23,6 @@ jobs:
- uses: IronCoreLabs/rust-toolchain@v1
- name: Run cargo update
run: cargo update
working-directory: ${{ inputs.rust_root || '.' }}
- name: Check for changes
id: changes
run: |
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/rust-ci-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jobs:
uses: ./.github/workflows/rust-ci.yaml
with:
run_clippy: true
rust_root: test/rust
test_matrix_include: |
[
{ rust_version: "", build_only: false },
Expand All @@ -26,7 +25,6 @@ jobs:
name: Rust Daily Test
uses: ./.github/workflows/rust-daily.yaml
with:
rust_root: test/rust
matrix_include: |
[
{ rust_version: "" },
Expand Down
34 changes: 2 additions & 32 deletions .github/workflows/rust-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ on:
type: boolean
default: false
required: false
rust_root:
description: Root of the rust code tree. May be a relative path.
type: string
required: false
test_matrix_rust_version:
description: 'A JS array list of versions to be included in the test matrix. Defaults to "["beta"]".'
required: false
Expand Down Expand Up @@ -73,24 +69,8 @@ on:
required: false

jobs:
# Assigns some variables, because GHA doesn't expand variables in inputs.*.default.
vars:
runs-on: ubuntu-24.04
outputs:
rust_root: ${{ steps.rust_root.outputs.rust_root }}
steps:
- id: rust_root
run: |
if [ -n "${{ inputs.rust_root }}" ] ; then
root="${{ inputs.rust_root }}"
else
root="."
fi
echo "rust_root=$root" >> $GITHUB_OUTPUT

cargo-test:
runs-on: ubuntu-24.04
needs: vars
env:
SCCACHE_AWS_SECRET: ${{ secrets.SCCACHE_AWS_SECRET_ACCESS_KEY }}
TOOL_CACHE_SECRET_KEY: ${{ secrets.TOOL_CACHE_SECRET_KEY }}
Expand Down Expand Up @@ -140,17 +120,14 @@ jobs:
if: ${{ matrix.rust_target != '' }}
run: echo "TARGET_FLAGS=--target ${{ matrix.rust_target }}" >> $GITHUB_ENV
- run: ${{inputs.cargo_command_env_vars}} cargo build ${{ matrix.build_args }}
working-directory: ${{ needs.vars.outputs.rust_root }}
- run: ${{inputs.cargo_command_env_vars}} cargo test ${{ matrix.test_args }} ${{ inputs.cargo_command_test_args }}
if: ${{ !matrix.build_only }}
working-directory: ${{ needs.vars.outputs.rust_root }}
- name: Print sccache stats
if: env.SCCACHE_AWS_SECRET != ''
run: sccache -s

coverage:
runs-on: ubuntu-24.04
needs: vars
env:
SCCACHE_AWS_SECRET: ${{ secrets.SCCACHE_AWS_SECRET_ACCESS_KEY }}
TOOL_CACHE_SECRET_KEY: ${{ secrets.TOOL_CACHE_SECRET_KEY }}
Expand Down Expand Up @@ -189,23 +166,21 @@ jobs:
- uses: taiki-e/install-action@cargo-llvm-cov
- name: Run llvm-cov
run: ${{inputs.cargo_command_env_vars}} cargo llvm-cov --html ${{ inputs.cargo_command_test_args }}
working-directory: ${{ needs.vars.outputs.rust_root }}
- name: Get Cobertura report as well
run: ${{inputs.cargo_command_env_vars}} cargo llvm-cov report --cobertura --output-path cobertura.xml
working-directory: ${{ needs.vars.outputs.rust_root }}
- name: Archive code coverage results
uses: actions/upload-artifact@v7
with:
name: code-coverage-report
path: ${{ needs.vars.outputs.rust_root }}/target/llvm-cov/html/
path: target/llvm-cov/html/
- name: Post code coverage to PR comment
if: ${{ github.base_ref != '' }}
# If this is run from a fork, this will fail to post a comment on the PR.
# Since the coverage is also uploaded as an artifact, we don't consider this fatal.
continue-on-error: true
uses: 5monkeys/cobertura-action@v14
with:
path: ${{ needs.vars.outputs.rust_root }}/cobertura.xml
path: cobertura.xml
repo_token: ${{ secrets.GITHUB_TOKEN }}
only_changed_files: true
show_line: true
Expand All @@ -214,7 +189,6 @@ jobs:

format:
runs-on: ubuntu-24.04
needs: vars
steps:
- name: Configure git ssh access
run: |
Expand All @@ -228,7 +202,6 @@ jobs:
with:
components: rustfmt
- run: ${{inputs.cargo_command_env_vars}} cargo fmt --all -- --check
working-directory: ${{ needs.vars.outputs.rust_root }}
- name: Install cargo-sort
uses: taiki-e/install-action@cargo-sort
- run: |
Expand All @@ -237,12 +210,10 @@ jobs:
else
${{inputs.cargo_command_env_vars}} cargo sort --check
fi
working-directory: ${{ needs.vars.outputs.rust_root }}

clippy:
name: Clippy
runs-on: ubuntu-24.04
needs: vars
if: inputs.run_clippy
steps:
- name: Configure git ssh access
Expand All @@ -262,4 +233,3 @@ jobs:
with:
components: clippy
- run: ${{inputs.cargo_command_env_vars}} cargo clippy -- -D warnings
working-directory: ${{ needs.vars.outputs.rust_root }}
23 changes: 0 additions & 23 deletions .github/workflows/rust-daily.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ name: Rust Daily
on:
workflow_call:
inputs:
rust_root:
description: Root of the rust code tree. May be a relative path.
type: string
required: false
rust_versions:
description: 'A JS array list of versions to be included in the test matrix. Defaults to `["beta"]` (stable will be implicitly added in the default `matrix_include`).'
required: false
Expand All @@ -37,30 +33,11 @@ on:
required: false

jobs:
# Assigns some variables, because GHA doesn't expand variables in inputs.*.default.
vars:
runs-on: ubuntu-24.04
outputs:
rust_root: ${{ steps.rust_root.outputs.rust_root }}
steps:
- id: rust_root
run: |
if [ -n "${{ inputs.rust_root }}" ] ; then
root="${{ inputs.rust_root }}"
else
root="${{ github.workspace }}"
fi
echo "rust_root=$root" >> $GITHUB_OUTPUT

cargo-check:
runs-on: ubuntu-24.04
needs: vars
env:
SCCACHE_AWS_SECRET: ${{ secrets.SCCACHE_AWS_SECRET_ACCESS_KEY }}
TOOL_CACHE_SECRET_KEY: ${{ secrets.TOOL_CACHE_SECRET_KEY }}
defaults:
run:
working-directory: ${{ needs.vars.outputs.rust_root }}
strategy:
matrix:
rust_version: "${{ fromJSON(inputs.rust_versions) }}"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading