diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index eebbd493cff..ed82de852aa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,10 +25,11 @@ jobs: os: ubuntu-latest container_image: alpine:3.21 host_dmd: ldmd2 + timeout_minutes: 60 # Alpine/musl currently pushes `test_phobos` beyond the 40 minute default budget # macOS - job_name: macOS x64 os: macos-14 - timeout-minutes: 60 + timeout_minutes: 120 # macOS generally takes more time than Linux/Alpine # Windows - job_name: Windows x64 os: windows-2022 @@ -38,7 +39,7 @@ jobs: name: ${{ matrix.job_name }} runs-on: ${{ matrix.os }} container: ${{ matrix.container_image }} - timeout-minutes: ${{ matrix.timeout-minutes || 40 }} + timeout-minutes: ${{ matrix.timeout_minutes || 40 }} env: # for ci/run.sh: OS_NAME: ${{ startsWith(matrix.os, 'ubuntu') && 'linux' || (startsWith(matrix.os, 'macos') && 'osx' || (startsWith(matrix.os, 'windows') && 'windows' || '')) }} @@ -61,7 +62,7 @@ jobs: fetch-depth: 50 - name: Clone DMD run: | - set -uexo pipefail + set -uxo pipefail ref='${{ github.ref }}' if [[ "$ref" =~ ^refs/pull/ ]]; then @@ -77,7 +78,13 @@ jobs: exit 1 fi - git clone --branch "$REPO_BRANCH" --depth 1 https://github.com/dlang/dmd.git ../dmd + # Clone DMD: try the specific branch, fall back to master if it doesn't exist + if git clone --branch "$REPO_BRANCH" --depth 1 https://github.com/dlang/dmd.git ../dmd 2>/dev/null; then + echo "Cloned dlang/dmd branch: $REPO_BRANCH" + else + echo "Branch '$REPO_BRANCH' not found; cloning master instead" + git clone --branch master --depth 1 https://github.com/dlang/dmd.git ../dmd + fi - name: Set environment variable N (parallelism) run: echo "N=$(${{ runner.os == 'macOS' && 'sysctl -n hw.logicalcpu' || 'nproc' }})" >> $GITHUB_ENV @@ -177,7 +184,13 @@ jobs: exit 1 fi - git clone --branch "$REPO_BRANCH" --depth 1 https://github.com/dlang/dmd.git ../dmd + # Clone DMD: try requested branch, fall back to master if missing + if git clone --branch "$REPO_BRANCH" --depth 1 https://github.com/dlang/dmd.git ../dmd 2>/dev/null; then + echo "Cloned dlang/dmd branch: $REPO_BRANCH" + else + echo "Branch '$REPO_BRANCH' not found; cloning master instead" + git clone --branch master --depth 1 https://github.com/dlang/dmd.git ../dmd + fi echo '::endgroup::' cd ../dmd