Skip to content

Commit

Permalink
Add publish-check-compile workflow
Browse files Browse the repository at this point in the history
This Applies staged prdocs then configures crate deps to pull from
crates.io for our already published crates and local paths for
things to be published. Then runs cargo check on the result.

This results in a build state consitent with that of publish time and
should catch compile errors that we would of otherwise ran into mid
pubish.

This acts as a supplement to the check-semver job. check-semver works on
a high level and judges what changes are incorrect and why. This job
just runs the change, sees if it compiles, and if not spits out
a compile error.
  • Loading branch information
Morganamilo committed Nov 21, 2024
1 parent ca8beae commit a7580b8
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/publish-check-compile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Check publish build

on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
merge_group:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
preflight:
uses: ./.github/workflows/reusable-preflight.yml

check-publish:
runs-on: ubuntu-latest
timeout-minutes: 90
needs: [preflight]
container:
image: ${{ needs.preflight.outputs.IMAGE }}
steps:
steps:
- uses: actions/checkout@6d193bf28034eafb982f37bd894289fe649468fc # v4.1.7

- name: Rust Cache
uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5
with:
cache-on-failure: true

- name: install parity-publish
run: cargo install [email protected] --locked -q

- name: parity-publish update plan
run: parity-publish --color always plan --skip-check --prdoc prdoc/

- name: parity-publish apply plan
run: parity-publish --color always apply --registry

- name: parity-publish check compile
run: |
packages="$(parity-publish apply --print)"
if [[ -n $packages ]]; then
cargo --color always check $(printf -- '-p %s ' $packages)
fi

0 comments on commit a7580b8

Please sign in to comment.