Skip to content

Commit 3b851a6

Browse files
committed
Refactor CI action (rust-lang#1024)
* This separates "setup" from "build"
1 parent 49999c2 commit 3b851a6

File tree

2 files changed

+21
-17
lines changed

2 files changed

+21
-17
lines changed

.github/actions/build/action.yml renamed to .github/actions/setup/action.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
# SPDX-License-Identifier: Apache-2.0 OR MIT
3-
name: Build Kani
4-
description: Install dependencies and build kani binaries
3+
name: Setup Kani Dependencies
54
inputs:
65
os:
76
description: In which Operating System is this running
87
required: true
9-
default: ubuntu-20.04
108
runs:
119
using: composite
1210
steps:
11+
# This is unfortunate, but cbmc-viewer currently requires Python >= 3.8
12+
- name: Install Python 3.9
13+
uses: actions/setup-python@v2
14+
with:
15+
python-version: '3.9'
16+
1317
- name: Install dependencies
1418
run: ./scripts/setup/${{ inputs.os }}/install_deps.sh
1519
shell: bash
@@ -30,10 +34,3 @@ runs:
3034
run: |
3135
git submodule update --init --depth 1
3236
shell: bash
33-
34-
- name: Build Kani and Kani Library
35-
run: |
36-
export RUST_BACKTRACE=1
37-
cargo build
38-
shell: bash
39-

.github/workflows/kani.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,17 @@ jobs:
1212
steps:
1313
- name: Checkout Kani
1414
uses: actions/checkout@v2
15-
- uses: actions/setup-python@v2
16-
with:
17-
python-version: '3.9'
1815

19-
- name: Build Kani
20-
uses: ./.github/actions/build
16+
- name: Setup Kani Dependencies
17+
uses: ./.github/actions/setup
2118
with:
2219
os: ${{ matrix.os }}
2320

21+
- name: Build Kani
22+
run: |
23+
export RUST_BACKTRACE=1
24+
cargo build
25+
2426
- name: Execute Kani regression
2527
run: ./scripts/kani-regression.sh
2628

@@ -32,11 +34,16 @@ jobs:
3234
- name: Checkout Kani
3335
uses: actions/checkout@v2
3436

35-
- name: Build Kani
36-
uses: ./.github/actions/build
37+
- name: Setup Kani Dependencies
38+
uses: ./.github/actions/setup
3739
with:
3840
os: ubuntu-20.04
3941

42+
- name: Build Kani
43+
run: |
44+
export RUST_BACKTRACE=1
45+
cargo build
46+
4047
- name: Install book runner dependencies
4148
run: ./scripts/setup/install_bookrunner_deps.sh
4249

0 commit comments

Comments
 (0)