Skip to content

Commit 6847b7d

Browse files
committed
Reuse build action
1 parent c16413c commit 6847b7d

File tree

3 files changed

+25
-32
lines changed

3 files changed

+25
-32
lines changed

.github/actions/build/action.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ inputs:
66
description: Human-readable job description
77
required: false
88
default: ''
9+
path:
10+
description: Path to project root
11+
required: false
12+
default: ''
913
buildtype:
1014
description: Build type
1115
required: false
@@ -34,6 +38,10 @@ inputs:
3438
description: B2 test properties to set
3539
required: false
3640
default: ''
41+
targets:
42+
description: B2 targets to build (separated by spaces)
43+
required: false
44+
default: ''
3745
b2_flags:
3846
description: Extra B2 flags to use
3947
required: false
@@ -73,6 +81,7 @@ runs:
7381
echo "VALGRIND_OPTS=${{ inputs.valgrind_opts }}" >> $GITHUB_ENV
7482
echo "B2_ASAN=${{ inputs.asan }}" >> $GITHUB_ENV
7583
echo "B2_UBSAN=${{ inputs.ubsan }}" >> $GITHUB_ENV
84+
echo "B2_TARGETS=${{ inputs.targets }}" >> $GITHUB_ENV
7685
echo "B2_FLAGS=${{ inputs.b2_flags }}" >> $GITHUB_ENV
7786
echo "DRONE_BUILD_EVENT=${{ github.event_name }}" >> $GITHUB_ENV
7887
echo "DRONE_JOB_BUILDTYPE=${{ inputs.buildtype }}" >> $GITHUB_ENV
@@ -84,8 +93,10 @@ runs:
8493
if: runner.os == 'Linux'
8594
shell: bash
8695
run: . .drone/drone.sh
96+
working-directory: ${{ inputs.path }}
8797

8898
- name: windows
8999
if: runner.os == 'Windows'
90100
shell: cmd
91101
run: call .drone/drone.bat
102+
working-directory: ${{ inputs.path }}

.github/workflows/run_analyze-bloat.yml

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ name: analyze-bloat
33
on: [push, pull_request]
44

55
env:
6-
DRONE_BUILD_EVENT: ${{ github.event_name }}
7-
DRONE_COMMIT: ${{ github.sha }}
8-
DRONE_JOB_BUILDTYPE: 'cmake-superproject'
96
CMAKE_SHARED_LIBS: '0'
107
CMAKE_OPTIONS: >
118
-DBOOST_JSON_BUILD_TESTS=OFF
@@ -24,13 +21,10 @@ jobs:
2421
with:
2522
path: 'head_ref/root'
2623
- name: Compile static lib for head ref
27-
env:
28-
DRONE_BRANCH: ${{ github.base_ref }}
29-
DRONE_REPO: ${{ github.repository }}
30-
run: |
31-
echo ${{ github.event_name }}
32-
cd head_ref/root
33-
. .drone/drone.sh
24+
uses: ./head_ref/root/.github/actions/build
25+
with:
26+
buildtype: 'cmake-superproject'
27+
path: 'head_ref/root'
3428
- name: Bloat analysis - absolute values
3529
uses: djarek/[email protected]
3630
with:
@@ -44,13 +38,10 @@ jobs:
4438
path: 'base_ref/root'
4539
- name: Compile static lib for base ref
4640
if: ${{ github.event_name == 'pull_request' }}
47-
env:
48-
DRONE_BRANCH: ${{ github.base_ref }}
49-
DRONE_REPO: ${{ github.repository }}
50-
run: |
51-
echo ${{ github.event_name }}
52-
cd base_ref/root
53-
. .drone/drone.sh
41+
uses: ./head_ref/root/.github/actions/build
42+
with:
43+
buildtype: 'cmake-superproject'
44+
path: 'base_ref/root'
5445
- name: Bloat analysis - diff
5546
uses: djarek/[email protected]
5647
if: ${{ github.event_name == 'pull_request' }}

.github/workflows/run_fuzzer.yml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,12 @@ jobs:
2323
path: head/fuzzing/corpus.tar
2424
key: corpus-${{ github.run_id }}
2525
restore-keys: corpus-
26-
- name: build and run
27-
env:
28-
CXX: clang++
29-
B2_TOOLSET: clang
30-
B2_VARIANT: release
31-
TRAVIS_OS_NAME: "linux"
32-
B2_TARGETS: libs/json/fuzzing//run
33-
DRONE_BUILD_EVENT: ${{ github.event_name }}
34-
DRONE_COMMIT: ${{ github.sha }}
35-
DRONE_BRANCH: ${{ github.base_ref }}
36-
DRONE_REPO: ${{ github.repository }}
37-
DRONE_JOB_BUILDTYPE: 'boost'
38-
run: |
39-
cd head
40-
. .drone/drone.sh
26+
- uses: ./head/.github/actions/build
27+
with:
28+
buildtype: 'boost'
29+
path: 'head'
30+
toolset: clang
31+
targets: libs/json/fuzzing//run
4132
- name: Pack the corpus
4233
working-directory: boost-root/libs/json/fuzzing/
4334
run: |

0 commit comments

Comments
 (0)