diff --git a/.github/workflows/build-test-deploy.yml b/.github/workflows/build-test-deploy.yml index d22196b3f..dc0fc9796 100644 --- a/.github/workflows/build-test-deploy.yml +++ b/.github/workflows/build-test-deploy.yml @@ -44,19 +44,13 @@ jobs: cd firmware make PROJECT=${{ steps.defaults.outputs.project_name }} PLATFORM=${{ steps.defaults.outputs.platform }} build + deploy: + runs-on: self-hosted + needs: build + environment: deploy + steps: - name: Upload artifacts uses: actions/upload-artifact@v4 with: name: build-artifact-${{ steps.defaults.outputs.sanitized_project_name }}-${{ steps.defaults.outputs.platform }} path: firmware/build/${{ steps.defaults.outputs.project_name }}/${{ steps.defaults.outputs.platform }} - -# deploy: -# runs-on: self-hosted -# needs: build -# environment: deploy -# steps: -# - name: Upload sanitized project artifacts -# uses: actions/upload-artifact@v4 -# with: -# path: firmware/build/${{ steps.defaults.outputs.sanitized_project_name }}-${{ steps.defaults.outputs.platform }} -# name: build-artifact-${{ steps.defaults.outputs.sanitized_project_name }}-${{ steps.defaults.outputs.platform }} diff --git a/.github/workflows/reusable-build-project.yml b/.github/workflows/reusable-build-project.yml new file mode 100644 index 000000000..95ff6f5fe --- /dev/null +++ b/.github/workflows/reusable-build-project.yml @@ -0,0 +1,25 @@ +name: Build Project + +on: + workflow_call: + inputs: + project: + description: 'Project to build (i.e. Demo/Blink)' + required: true + type: string + platform: + description: 'Platform to build for (i.e. cli, stm32f767)' + required: true + type: string + +jobs: + build: + runs-on: self-hosted + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Build ${{ github.event.inputs.project }} for ${{ github.event.inputs.platform }} + run: | + cd firmware + make PROJECT=${{ github.event.inputs.project }} PLATFORM=${{ github.event.inputs.platform }} build diff --git a/.github/workflows/test-project-name.yml b/.github/workflows/test-project-name.yml index 0fd4ca0bb..ddf564209 100644 --- a/.github/workflows/test-project-name.yml +++ b/.github/workflows/test-project-name.yml @@ -7,15 +7,8 @@ jobs: test-string-replacement: runs-on: ubuntu-latest steps: - - name: Test project name sanitization - id: sanitize - run: | - project_name="Demo/Blink" - sanitized_name="${project_name//\//-}" - echo "Original project name: $project_name" - echo "Sanitized project name: $sanitized_name" - echo "::set-output name=sanitized_name::$sanitized_name" - - - name: Display sanitized project name - run: | - echo "Sanitized project name is: ${{ steps.sanitize.outputs.sanitized_name }}" \ No newline at end of file + - name: Build project + uses: ./github-actions/reusable-build-project + with: + project: Demo/Blink + platform: cli \ No newline at end of file