Packaging fix: Allow dcpmd usage from dutagent service #226
Workflow file for this run
This file contains hidden or 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
| --- | |
| name: fwci-test | |
| # Gorelease is used only as build-tool, not handling actual releases. | |
| on: | |
| pull_request: {} | |
| merge_group: {} | |
| push: | |
| branches: ["main"] | |
| tags: ["v*"] | |
| env: | |
| APPLY_FIXES: none | |
| APPLY_FIXES_EVENT: pull_request | |
| APPLY_FIXES_MODE: commit | |
| DISABLE_TELEMETRY: 1 | |
| concurrency: | |
| group: ${{ github.ref }}-${{ github.workflow }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| # Job to build binaries and linux packages with goreleaser, without making release | |
| build-with-goreleaser: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Set up Go | |
| uses: actions/setup-go@v7 | |
| with: | |
| go-version: stable | |
| - name: Build packages with goreleaser (without actually making release) | |
| run: | | |
| go install github.com/goreleaser/goreleaser/v2@latest | |
| goreleaser release --draft --snapshot --clean | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: binaries | |
| path: bin/ | |
| retention-days: 14 days | |
| # Run a firmware-ci test suite | |
| client-agent-integration: | |
| # Pull requests from forks run without repository secrets, so FWCI_TOKEN | |
| # would be empty here. The fwci-contrib workflow picks those up instead, from | |
| # the base repository and behind a required-reviewer environment. | |
| if: >- | |
| github.event_name != 'pull_request' || | |
| github.event.pull_request.head.repo.full_name == github.repository | |
| runs-on: ubuntu-latest | |
| needs: | |
| - build-with-goreleaser | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| configfile: | |
| - ./contrib/dutagent-cfg-example.yaml | |
| #- ./test/test-dutagent-cfg.yaml | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: binaries | |
| path: bin/ | |
| - name: Get names of binaries | |
| id: filenames | |
| run: | | |
| echo "dutctl_path=$(ls ./bin/dutctl_linux_amd64_*/dutctl)" >> "${GITHUB_OUTPUT}" | |
| echo "dutctl_pkg_path=$(ls ./bin/dutctl_*_arm64.deb)" >> "${GITHUB_OUTPUT}" | |
| - name: Debug | |
| run: | | |
| echo "dutctl_path: ${{ steps.filenames.outputs.dutctl_path }}" | |
| echo "dutctl_pkg_path: ${{ steps.filenames.outputs.dutctl_pkg_path }}" | |
| - name: Upload to FirmwareCI | |
| uses: docker://firmwareci/action:v6.0 | |
| with: | |
| TOKEN: "${{ secrets.FWCI_TOKEN }}" | |
| WORKFLOW_NAME: test-dutctl | |
| COMMIT_HASH: ${{ github.event.pull_request.head.sha || github.sha }} | |
| BINARIES: DUTCTL=${{ steps.filenames.outputs.dutctl_path }};REMOTE_PKG=${{ steps.filenames.outputs.dutctl_pkg_path }};CONFIG=${{ matrix.configfile }} | |
| GITHUB_INSTALLATION_ID: 45795153 | |
| # Get a list of all configuration files in JSON format | |
| get-matrix: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: get-matrix | |
| id: get-matrix | |
| run: | | |
| # Disable SC2046: Quote this to prevent word splitting | |
| # I can't quote this, just look at it | |
| # shellcheck disable=SC2046 | |
| echo matrix=$( find ./pkg/module/ ./test/ ./cmds/exp/contrib/ -regex '.*\.ya?ml' -type f -print0 | jq -Rs 'split("\u0000")[:-1]' ) >> "${GITHUB_OUTPUT}" | |
| - name: Check | |
| run: | | |
| jq . <<< '${{ steps.get-matrix.outputs.matrix }}' | |
| outputs: | |
| matrix: ${{ steps.get-matrix.outputs.matrix }} | |
| # Validate all configuration files with dutagent | |
| validate-config: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - get-matrix | |
| - build-with-goreleaser | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| configfile: ${{ fromJson(needs.get-matrix.outputs.matrix) }} | |
| include: | |
| - configfile: './contrib/dutagent-cfg-example.yaml' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: binaries | |
| path: bin/ | |
| - name: Get names of binary | |
| id: filenames | |
| run: | | |
| echo "dutagent_path=$(ls ./bin/dutagent_linux_amd64_*/dutagent)" >> "${GITHUB_OUTPUT}" | |
| - name: Run validation | |
| run: | | |
| chmod +x ${{ steps.filenames.outputs.dutagent_path }} | |
| ${{ steps.filenames.outputs.dutagent_path }} -check-config -c "${{ matrix.configfile }}" |