diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 82cc52a9..9a204aca 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -30,10 +30,10 @@ jobs: runs-on: "ubuntu-latest" needs: prepare-matrix strategy: - max-parallel: 4 # avoid using all workers from the pool + max-parallel: 15 # avoid using all workers from the org pool fail-fast: false matrix: - dist_name: ${{ fromJson(needs.prepare-matrix.outputs.matrix) }} + dist_name: ['ipfs-pack'] # TODO ${{ fromJson(needs.prepare-matrix.outputs.matrix) }} steps: - uses: actions/checkout@v2 - name: Setup IPFS @@ -44,6 +44,43 @@ jobs: timeout-minutes: 5 - run: cd ./dists/${{ matrix.dist_name }} && make nightly - run: ./dockerized make publish + - name: Create issue if build failed + uses: actions/github-script@v4 + if: ${{ failure() }} + with: + script: | + const title = 'Nightly build failed for ${{ matrix.dist_name }}' + const body = '${{ matrix.dist_name }} failed to build nightly from revision ${{ github.sha }}: https://github.com/ipfs/distributions/actions/runs/${{ github.run_id }}' + const opts = { owner: context.repo.owner, repo: context.repo.repo } + const response = await github.search.issuesAndPullRequests({ + q: `repo:ipfs/distributions is:issue is:open in:title ${title}` + }) + console.log('github.issuesAndPullRequests', response) + let link + if (response.data.items.length === 0) { + const created = await github.issues.create({ ...opts, title, body, + labels: ['kind/bug', 'need/triage'] + }) + console.log('no open issues, created a new one', created) + link = created.html_url + } + for (const issue of response.data.items) { + if (issue.title !== title) continue + console.log('found existing open issue', issue) + const created = await github.issues.createComment({ ...opts, + issue_number: issue.number, + body + }) + console.log('commented on existing open issue', created) + link = created.html_url + } + await github.repos.createCommitStatus({ ...opts, + sha: '${{ github.sha }}', + state: 'error', + target_url: link, + context: 'Problem with ${{ matrix.dist_name }}', + description: 'See details in the linked issue' + }) - name: Inspect git status and contents of ./releases run: git status && ls -Rhl ./releases - name: Read CID of updated DAG