mirror of
https://github.com/dlang/dmd.git
synced 2025-04-25 20:50:41 +03:00
CI: Move some Cirrus CI jobs to GitHub Actions
This commit is contained in:
parent
59e224a2da
commit
f999f35810
2 changed files with 93 additions and 26 deletions
93
.github/workflows/main.yml
vendored
Normal file
93
.github/workflows/main.yml
vendored
Normal file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue