test: main#951fffc765141f872132757e8c1b147a426775ca #113
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
| # YAML -*- mode: yaml; tab-width: 2; indent-tabs-mode: nil; coding: utf-8 -*- | |
| --- | |
| name: test | |
| # yamllint disable-line rule:line-length | |
| run-name: "test: ${{ github.event.workflow_run.head_branch }}#${{ github.event.workflow_run.head_commit.id }}" | |
| on: # yamllint disable-line rule:truthy | |
| workflow_run: | |
| workflows: ["build"] | |
| types: | |
| - completed | |
| # https://github.com/orgs/community/discussions/58868 | |
| jobs: | |
| test: | |
| permissions: | |
| contents: read | |
| statuses: write | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
| steps: | |
| # - name: Download image | |
| # id: image | |
| # # yamllint disable-line rule:line-length | |
| # uses: rzr/container-image-artifact-download@main # v2.0.0 | |
| # with: | |
| # image: "${{ github.event.repository.name }}:latest" | |
| # workflow: "build" | |
| # token: ${{ secrets.GH_CROSSSTREAM_ACCESS_TOKEN }} | |
| # workflow_run_id: ${{ github.event.workflow_run.id }} | |
| # download_tmp_dir: ${{ runner.temp }} | |
| # - name: Check downloaded artifact | |
| # run: | | |
| # echo "TODO: https://github.com/ishworkh/container-image-artifact-download/issues/7#issuecomment-2904751460" | |
| # echo find ${{ runner.temp }}/ | |
| # find ${{ steps.image.outputs.download_path }} | |
| # echo "TODO: Compare if matching the build artifacts" | |
| # sha256sum ${{ env.file }} | |
| # file -E ${{ env.file }} | grep -E ': POSIX tar archive' | |
| # tar -xOf ${{ env.file }} manifest.json | jq | |
| # echo "TODO: https://docs.docker.com/engine/security/trust/" | |
| # rm -rfv "${{ env.file }}" | |
| # env: | |
| # file: ${{ steps.image.outputs.download_path }} | |
| # - name: release-downloader | |
| # uses: robinraju/release-downloader@v1.12 | |
| # with: | |
| # repository: crossstream/crossstream | |
| # fileName: '*.txt' | |
| # latest: true | |
| # - name: zw-downloader | |
| # uses: robinraju/release-downloader@v1.12 | |
| # with: | |
| # repository: 'Z-Wave-Alliance/z-wave-stack-binaries' | |
| # fileName: 'z-wave-stack-binaries-*-Linux.tar.gz' | |
| # token: ${{ secrets.GH_ZWAVE_ACCESS_TOKEN }} | |
| # latest: true | |
| # - uses: actions/checkout@v4 | |
| # with: | |
| # fetch-depth: 0 | |
| # ref: ${{ github.event.workflow_run.head_commit.id }} | |
| - name: Download artifacts | |
| # yamllint disable-line rule:line-length | |
| uses: actions/download-artifact@main | |
| with: | |
| # yamllint disable-line | |
| name: ${{ github.event.repository.name }}-bin | |
| github-token: ${{ secrets.GH_CROSSSTREAM_ACCESS_TOKEN }} | |
| run-id: ${{ github.event.workflow_run.id }} | |
| path: ${{ runner.temp }} # Default is $GITHUB_WORKSPACE | |
| - name: run | |
| id: run | |
| working-directory: ${{ runner.temp }} ## echo ${{ GITHUB_WORKSPACE }} | |
| env: | |
| # working-directory: # /home/runner/work/crossstream/crossstream | |
| file: bin/run.sh | |
| run: | | |
| set +x | |
| pwd | |
| find ./ | |
| echo "runner" | |
| # find /home/runner/work/_temp | |
| find /home/runner/work # ok | |
| # find /home/runner/ # lot of stuff | |
| # pwd && find '$PWD' && bash ${{ env.file }} | |
| # continue-on-error: true | |
| # - name: Report | |
| # uses: actions/github-script@v7 | |
| # if: always() | |
| # env: | |
| # status: ${{ steps.run.outcome }} | |
| # sha: ${{ github.event.workflow_run.head_commit.id }} | |
| # with: | |
| # github-token: ${{ secrets.GH_CROSSSTREAM_ACCESS_TOKEN }} | |
| # script: | | |
| # await github.rest.repos.createCommitStatus({ | |
| # owner: context.repo.owner, | |
| # repo: context.repo.repo, | |
| # sha: process.env.sha, | |
| # state: process.env.status | |
| # }); | |
| # process.exit(process.env.status == 'success' ? 0 : 1); | |
| - id: test | |
| run: | |
| exit 1 | |
| - name: Propagate status on fail | |
| # yamllint disable-line rule:line-length | |
| uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | |
| if: failure() | |
| env: | |
| status: ${{ steps.run.outcome }} | |
| ref: ${{ github.event.workflow_run.head_commit.id }} | |
| with: | |
| script: | | |
| const status = await github.rest.repos.getCombinedStatusForRef({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| ref: process.env.ref, | |
| }); | |
| core.info(`Combined status: ${status.data.state}`); | |
| await github.rest.repos.createCommitStatus({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| sha: process.env.ref, | |
| state: 'failure' | |
| }) | |
| core.setFailed(`Status: ${process.env.status}`); |