Skip to content
This repository has been archived by the owner on Feb 9, 2023. It is now read-only.

Request: Multiple builds from different configs #11

Closed
ghost opened this issue Dec 14, 2020 · 3 comments
Closed

Request: Multiple builds from different configs #11

ghost opened this issue Dec 14, 2020 · 3 comments
Assignees

Comments

@ghost
Copy link

ghost commented Dec 14, 2020

At the moment, we can supply our own configuration file pairs, and they are copied over the originals before a build, and it's working well.

I was thinking, it would be nice to have a way to build two (or more) firmwares at a time, to compare their results. Of course, I could do this manually by just making one then making the other, but it would be nice to only have to press the magic button once ;)

I'm hoping this might be very simple, rather than copying the file pairs before the build, it could look for directories there, and do one build for each directory it finds, with the config files from that directory.

What do you think?

@frealmyr frealmyr self-assigned this Jan 4, 2021
@frealmyr
Copy link
Owner

frealmyr commented Jan 4, 2021

We can probably do both? If there are .h files in config directory, compile a single firmware bin. If there are folders there, go recursively inside each folder and build to the corresponding compiled firmware folder? 😄

@ghost
Copy link
Author

ghost commented Jan 4, 2021

Sounds great!
This project has finally put a fire under me to learn more about docker so hopefully I can contribute in future if you would like some help?

@frealmyr
Copy link
Owner

I considered modifying the script to accommodate for this, however it would increase the complexity a fair bit. Since this is a edge-case, i recommend solving it in a more static approach using Github Actions.

Create multiple GHA workflows, where you change out the monitored folders and docker volumes with sub-folders of choice. If you make changes in the sub-folder, only the corresponding firmware will be generated.

Example:


name: Build Marlin Firmware

on:
  push:
    branches:
      - master
    paths:
      - 'Firmware/Configuration/Example1/**.h'

jobs:
  build_and_push:
    name: Compile and Push Firmware
    runs-on: ubuntu-latest
    env:
      BOARD: STM32F103RC_btt_512K

    steps:
      - name: Check out repo
        uses: actions/checkout@v2

      - name: Compile firmware
        run: |
          docker run \
            -u root:root \
            -e BOARD \
            -e UPDATE_FORCE=true \
            -v $(pwd)/Firmware/Builds/Example1:/home/platformio/build \
            -v $(pwd)/Firmware/Configuration/Example1:/home/platformio/CustomConfiguration \
            frealmyr/marlin-build:latest
      - name: Push firmware
        run: |
          git config user.name github-actions
          git config user.email github-actions@github.com
          git add .
          git commit -m "Compiled firmware"
          git push

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant