-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1125 from bitcraze/krichardsson/ci-targets-in-file
Use a file to define build targets
- Loading branch information
Showing
5 changed files
with
77 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,68 +14,17 @@ permissions: | |
contents: read | ||
|
||
jobs: | ||
cf2: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- name: build | ||
run: docker run --rm -v ${PWD}:/module bitcraze/builder bash -c "make defconfig && ./tools/build/build UNIT_TEST_STYLE=min" | ||
|
||
- name: Upload Build Artifact | ||
uses: actions/[email protected] | ||
with: | ||
name: cf2-${{ github.sha }} | ||
path: | | ||
cf2.bin | ||
cf2.elf | ||
bolt: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- name: build | ||
run: docker run --rm -v ${PWD}:/module bitcraze/builder bash -c "make bolt_defconfig && ./tools/build/build UNIT_TEST_STYLE=min" | ||
|
||
- name: Upload Build Artifact | ||
uses: actions/[email protected] | ||
with: | ||
name: bolt-${{ github.sha }} | ||
path: | | ||
bolt.bin | ||
bolt.elf | ||
read_targets_from_file: | ||
uses: ./.github/workflows/read_build_targets.yml | ||
|
||
tag: | ||
basic_build: | ||
needs: read_targets_from_file | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- name: build | ||
run: docker run --rm -v ${PWD}:/module bitcraze/builder bash -c "make tag_defconfig && ./tools/build/build UNIT_TEST_STYLE=min" | ||
|
||
- name: Upload Build Artifact | ||
uses: actions/[email protected] | ||
with: | ||
name: tag-${{ github.sha }} | ||
path: | | ||
tag.bin | ||
tag.elf | ||
cfbl: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
${{fromJson(needs.read_targets_from_file.outputs.platforms)}} | ||
|
||
steps: | ||
- name: Checkout Repo | ||
|
@@ -84,19 +33,19 @@ jobs: | |
submodules: true | ||
|
||
- name: build | ||
run: docker run --rm -v ${PWD}:/module bitcraze/builder bash -c "make cfbl_defconfig && ./tools/build/build UNIT_TEST_STYLE=min" | ||
run: docker run --rm -v ${PWD}:/module bitcraze/builder bash -c "make ${{ matrix.platform }}_defconfig && ./tools/build/build UNIT_TEST_STYLE=min" | ||
|
||
- name: Upload Build Artifact | ||
uses: actions/[email protected] | ||
with: | ||
name: cfbl-${{ github.sha }} | ||
name: ${{ matrix.platform }}-${{ github.sha }} | ||
path: | | ||
cfbl.bin | ||
cfbl.elf | ||
${{ matrix.platform }}.bin | ||
${{ matrix.platform }}.elf | ||
features: | ||
runs-on: ubuntu-latest | ||
needs: cf2 | ||
needs: basic_build | ||
|
||
strategy: | ||
fail-fast: false | ||
|
@@ -132,7 +81,7 @@ jobs: | |
|
||
apps: | ||
runs-on: ubuntu-latest | ||
needs: cf2 | ||
needs: basic_build | ||
|
||
strategy: | ||
fail-fast: false | ||
|
@@ -160,7 +109,7 @@ jobs: | |
|
||
kbuild-targets: | ||
runs-on: ubuntu-latest | ||
needs: cf2 | ||
needs: basic_build | ||
|
||
strategy: | ||
fail-fast: false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# This work flow checks out the repo and reads the list of release targets from | ||
# the build_targetst.json file. | ||
|
||
# The list of targets is available in needs.read_targets_from_file.outputs.platforms as a json dictionary, use it | ||
# in matrix like this: ${{fromJson(needs.read_targets_from_file.outputs.platforms)}} | ||
|
||
name: Read build targets | ||
|
||
on: | ||
workflow_call: | ||
outputs: | ||
platforms: | ||
description: "'platform' is set to the list of targets" | ||
value: ${{ jobs.read_targets_from_file.outputs.platforms }} | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
read_targets_from_file: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
platforms: ${{ steps.read-build-target-from-file.outputs.platforms }} | ||
|
||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: false | ||
|
||
- id: read-build-target-from-file | ||
run: | | ||
content=`cat ./build_targets.json` | ||
# the following lines are required for multi line json | ||
content="${content//'%'/'%25'}" | ||
content="${content//$'\n'/'%0A'}" | ||
content="${content//$'\r'/'%0D'}" | ||
# end of handling for multi line json | ||
echo "::set-output name=platforms::$content" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"platform" : [ | ||
"cf2", | ||
"bolt", | ||
"tag" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters