diff --git a/.cirrus.yml b/.cirrus.yml index 56b911f13e..2d4b4bd367 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -64,24 +64,12 @@ linux_task: timeout_in: 60m environment: matrix: - - TASK_NAME_SUFFIX: x86, DMD (latest) - MODEL: 32 - TASK_NAME_SUFFIX: x86, DMD (coverage) MODEL: 32 << : *COVERAGE_ENVIRONMENT_TEMPLATE - - TASK_NAME_SUFFIX: x86, DMD (bootstrap) - MODEL: 32 - HOST_DMD: dmd-2.097.1 - - TASK_NAME_SUFFIX: x64, DMD (latest) # Enable this to replace coverage tests on CircleCI # - TASK_NAME_SUFFIX: x64, DMD (coverage) # << : *COVERAGE_ENVIRONMENT_TEMPLATE - - TASK_NAME_SUFFIX: x64, DMD (bootstrap) - HOST_DMD: dmd-2.079.0 - - TASK_NAME_SUFFIX: x64, LDC - HOST_DC: ldc #TODO: Update to HOST_DMD when support for HOST_DC is removed - - TASK_NAME_SUFFIX: x64, GDC - HOST_DMD: gdmd-9 << : *COMMON_STEPS_TEMPLATE # Mac @@ -95,23 +83,9 @@ macos13_task: # override Cirrus default OS (`darwin`) OS: osx matrix: - - TASK_NAME_SUFFIX: DMD (latest) - TASK_NAME_SUFFIX: DMD (coverage) << : *COVERAGE_ENVIRONMENT_TEMPLATE << : *COMMON_STEPS_TEMPLATE -macos12_task: - name: macOS 12.x x64 (M1), DMD (bootstrap) - macos_instance: - image: ghcr.io/cirruslabs/macos-monterey-xcode:latest - timeout_in: 60m - environment: - OS_NAME: darwin - # override Cirrus default OS (`darwin`) - OS: osx - # de-facto bootstrap version on OSX - # See: https://github.com/dlang/dmd/pull/13890 - HOST_DMD: dmd-2.099.1 - << : *COMMON_STEPS_TEMPLATE # FreeBSD freebsd13_task: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000000..05e2c3735b --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,93 @@ +# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions + +name: Main +on: + - pull_request # without merge conflicts + - push # branch or tag + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + strategy: + fail-fast: false + matrix: + include: + # Linux + - job_name: Ubuntu 22.04 x64, DMD (latest) + os: ubuntu-22.04 + host_dmd: dmd + - job_name: Ubuntu 22.04 x64, DMD (bootstrap) + os: ubuntu-22.04 + host_dmd: dmd-2.079.0 + - job_name: Ubuntu 22.04 x86, DMD (latest) + os: ubuntu-22.04 + model: 32 + host_dmd: dmd + - job_name: Ubuntu 22.04 x86, DMD (bootstrap) + os: ubuntu-22.04 + model: 32 + host_dmd: dmd-2.097.1 + - job_name: Ubuntu 22.04 x64, LDC + os: ubuntu-22.04 + host_dmd: ldc + - job_name: Ubuntu 22.04 x64, GDC + os: ubuntu-22.04 + host_dmd: gdmd-9 + # macOS + - job_name: macOS 13 x64, DMD (latest) + os: macos-13 + host_dmd: dmd + - job_name: macOS 12 x64, DMD (bootstrap) + os: macos-12 + # de-facto bootstrap version on OSX + # See: https://github.com/dlang/dmd/pull/13890 + host_dmd: dmd-2.099.1 + name: ${{ matrix.job_name }} + runs-on: ${{ matrix.os }} + timeout-minutes: 40 + env: + # for ci/run.sh: + OS_NAME: ${{ startsWith(matrix.os, 'ubuntu') && 'linux' || (startsWith(matrix.os, 'macos') && 'darwin' || '') }} + MODEL: ${{ matrix.model || '64' }} + HOST_DMD: ${{ matrix.host_dmd }} + N: ${{ startsWith(matrix.os, 'macos') && '3' || '2' }} + FULL_BUILD: true + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 50 + - name: Install prerequisites + run: ${{ runner.os == 'macOS' && 'ci/cirrusci.sh' || 'sudo -E ci/cirrusci.sh' }} + - name: Install host compiler + run: ci/run.sh install_host_compiler + - name: Set up repos + run: | + set -uexo pipefail + ln -s "$GITHUB_WORKSPACE" ../dmd + + ref='${{ github.ref }}' + if [[ "$ref" =~ ^refs/pull/ ]]; then + # PR: clone the Phobos head with the same name as this DMD PR's target branch + # e.g., Phobos stable when targeting DMD stable + REPO_BRANCH="$GITHUB_BASE_REF" + elif [[ "$ref" =~ ^refs/(heads|tags)/(.*)$ ]]; then + # no PR: try to clone the Phobos head with the same name as this DMD head, falling back to master + # e.g., Phobos stable for a push to DMD stable, or Phobos v2.105.2 for DMD tag v2.105.2 + REPO_BRANCH="${BASH_REMATCH[2]}" + else + echo "Error: unexpected GitHub ref '$ref'" >&2 + exit 1 + fi + + ./ci/run.sh setup_repos "$REPO_BRANCH" + - name: Build + run: ci/run.sh build + - name: Test dmd + run: ci/run.sh test_dmd + - name: Test druntime + run: ci/run.sh test_druntime + - name: Test phobos + run: ci/run.sh test_phobos