Skip to content

Commit

Permalink
[Devtools] Small improvements to metadata handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshLind committed Aug 6, 2024
1 parent ef343b7 commit 9662ea3
Show file tree
Hide file tree
Showing 5 changed files with 326 additions and 82 deletions.
19 changes: 19 additions & 0 deletions .github/actions/rust-check-merge-base/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Rust Check Merge Base
description: Runs the rust merge base freshness check
inputs:
GIT_CREDENTIALS:
description: "Optional credentials to pass to git. Useful if you need to pull private repos for dependencies"
required: false

runs:
using: composite
steps:
# The source code must be checked out by the workflow that invokes this action.
- uses: aptos-labs/aptos-core/.github/actions/rust-setup@main
with:
GIT_CREDENTIALS: ${{ inputs.GIT_CREDENTIALS }}

# Check the freshness of the merge base
- name: Check the freshness of the merge base
run: cargo x check-merge-base -vvv
shell: bash
6 changes: 3 additions & 3 deletions .github/actions/rust-targeted-unit-tests/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ runs:

# Output the changed files
- name: Output the changed files
run: cargo x changed-files -vv
run: cargo x changed-files -vvv
shell: bash

# Output the affected packages
- name: Output the affected packages
run: cargo x affected-packages -vv
run: cargo x affected-packages -vvv
shell: bash

# Run only the targeted rust unit tests
- name: Run only the targeted unit tests
run: |
cargo x targeted-unit-tests -vv --profile ci --cargo-profile ci --locked --no-fail-fast --retries 3
cargo x targeted-unit-tests -vvv --profile ci --cargo-profile ci --locked --no-fail-fast --retries 3
shell: bash
env:
INDEXER_DATABASE_URL: postgresql://postgres@localhost/postgres
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,24 @@ jobs:
- run: echo "Skipping rust smoke tests! Unrelated changes detected."
if: needs.file_change_determinator.outputs.only_docs_changed == 'true'

# Check the freshess of the merge base. This is a PR required job.
rust-check-merge-base:
if: | # Don't run on release branches
(
!contains(github.event.pull_request.base.ref, '-release-')
)
needs: file_change_determinator
runs-on: runs-on,cpu=64,family=c7,hdd=500,image=aptos-ubuntu-x64,run-id=${{ github.run_id }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0 # Fetch all git history for accurate target determination
- name: Run the merge base freshness check
uses: ./.github/actions/rust-check-merge-base
with:
GIT_CREDENTIALS: ${{ secrets.GIT_CREDENTIALS }}

# Run only the targeted rust unit tests. This is a PR required job.
rust-targeted-unit-tests:
if: | # Don't run on release branches. Instead, all unit tests will be triggered.
Expand Down
Loading

0 comments on commit 9662ea3

Please sign in to comment.