forked from argumentcomputer/ci-workflows
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (44 loc) · 1.65 KB
/
check-lurk-compiles.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Check upstream `lurk-rs` compiles
on:
workflow_call:
inputs:
runner:
required: false
default: 'ubuntu-latest'
type: string
jobs:
check-lurk-compiles:
if: github.event_name == 'pull_request'
runs-on: ${{ inputs.runner }}
steps:
steps:
- uses: actions/checkout@v4
with:
repository: lurk-lab/ci-workflows
- uses: ./.github/actions/ci-env
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: lurk-lab/lurk-rs
path: ./lurk-rs
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Patch Cargo.toml
working-directory: ${{ github.workspace }}/lurk-rs
run: |
URL=https://github.com/${{ github.repository }}
# the dependency we want to patch is usually the same as the package, but
# we e.g. want to override dependency 'nova' with an 'arecibo' package
DEPENDENCY=$(grep "git = \"$URL\"" Cargo.toml | awk '{ print $1 }')
PACKAGE=$(grep "git = \"$URL\"" Cargo.toml | grep -oP 'package = "\K[^"]*'| cat)
echo "[patch.'$URL']" >> Cargo.toml
if [ ! -z "$PACKAGE" ];
then
echo "$DEPENDENCY = { path='../', package='$PACKAGE' }" >> Cargo.toml
else
echo "$DEPENDENCY = { path='../' }" >> Cargo.toml
fi
- name: Check Lurk-rs types don't break spectacularly
working-directory: ${{ github.workspace }}/lurk-rs
run: cargo check --workspace --tests --benches --examples