Repository navigation
mcp #924
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: Pentoo Build Test | |
| on: | |
| pull_request: | |
| branches: | |
| - master | |
| jobs: | |
| skip-check: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| should_skip: ${{ steps.check.outputs.skip }} | |
| steps: | |
| - | |
| name: Check if already passed for this commit | |
| id: check | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| HEAD_SHA="${{ github.event.pull_request.head.sha }}" | |
| WORKFLOW_NAME="${{ github.workflow }}" | |
| WORKFLOW_ID=$(gh api "repos/${{ github.repository }}/actions/workflows" | \ | |
| jq -r --arg name "$WORKFLOW_NAME" '.workflows[] | select(.name == $name) | .id') | |
| PARENTS=$(gh api "repos/${{ github.repository }}/commits/${HEAD_SHA}" --jq '.parents[].sha' 2>/dev/null || true) | |
| SUCCESSFUL=0 | |
| for SHA in ${HEAD_SHA} ${PARENTS}; do | |
| COUNT=$(gh api \ | |
| "repos/${{ github.repository }}/actions/workflows/${WORKFLOW_ID}/runs?head_sha=${SHA}&per_page=10" \ | |
| --jq "[.workflow_runs[] | select(.conclusion == \"success\" and .id != ${{ github.run_id }})] | length") | |
| if [ "${COUNT:-0}" -gt "0" ]; then | |
| SUCCESSFUL=1 | |
| break | |
| fi | |
| done | |
| if [ "${SUCCESSFUL}" -gt "0" ]; then | |
| echo "Workflow already passed for a related commit, skipping." | |
| echo "skip=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "skip=false" >> $GITHUB_OUTPUT | |
| fi | |
| pentoo-build-test: | |
| needs: skip-check | |
| if: needs.skip-check.outputs.should_skip != 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - | |
| name: df1 | |
| run: df -h | |
| - | |
| name: Cleanup worker diskspace | |
| run: | | |
| sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL | |
| sudo docker image prune --all --force | |
| sudo docker builder prune -a | |
| - | |
| name: df2 | |
| run: df -h | |
| - | |
| name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - | |
| name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - | |
| name: List added files | |
| run: git --no-pager diff --name-only "$(git rev-parse --verify origin/master 2> /dev/null)" HEAD | |
| - | |
| name: Pentoo Build Test | |
| run: | | |
| sudo docker build --progress=plain . -f scripts/qa/Dockerfile.build |