mirror of
https://github.com/dlang/dmd.git
synced 2025-04-25 12:40:11 +03:00
GHA: Add workflow for testing bootstrap with every release from D 2.076.1
This commit is contained in:
parent
4fd3fb0e69
commit
4ea14d4dc6
2 changed files with 82 additions and 3 deletions
76
.github/workflows/bootstrap.yml
vendored
Normal file
76
.github/workflows/bootstrap.yml
vendored
Normal file
|
@ -0,0 +1,76 @@
|
|||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
|
||||
|
||||
name: Bootstrap
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- stable
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- stable
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
main:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
version: [
|
||||
2.076.1, 2.077.1, 2.078.3, 2.079.1,
|
||||
2.080.1, 2.081.2, 2.082.1, 2.083.1, 2.084.1, 2.085.1, 2.086.1, 2.087.1, 2.088.1, 2.089.1,
|
||||
2.090.1, 2.091.1, 2.092.1, 2.093.1, 2.094.2, 2.095.1, 2.096.1, 2.097.2, 2.098.1, 2.099.1,
|
||||
2.100.2, 2.101.2, 2.102.2, 2.103.1, 2.104.2, 2.105.3, 2.106.1, 2.107.1
|
||||
]
|
||||
|
||||
name: Build with dmd-${{ matrix.version }}
|
||||
runs-on: ubuntu-22.04
|
||||
timeout-minutes: 10
|
||||
env:
|
||||
# for ci/run.sh:
|
||||
OS_NAME: linux
|
||||
MODEL: 64
|
||||
HOST_DMD: dmd-${{ matrix.version }}
|
||||
# N is set dynamically below
|
||||
FULL_BUILD: true
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 50
|
||||
|
||||
- name: Set environment variable N (parallelism)
|
||||
run: echo "N=$(nproc)" >> $GITHUB_ENV
|
||||
|
||||
- name: Install host compiler
|
||||
run: ci/run.sh install_host_compiler
|
||||
|
||||
- name: Set up repos
|
||||
run: |
|
||||
set -uexo pipefail
|
||||
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 dmd
|
||||
run: ENABLE_RELEASE=0 ENABLE_DEBUG=0 ci/run.sh build 0
|
||||
|
||||
- name: Rebuild dmd
|
||||
run: ENABLE_RELEASE=0 ENABLE_DEBUG=0 ci/run.sh rebuild
|
|
@ -58,12 +58,15 @@ clone() {
|
|||
|
||||
# build dmd (incl. building and running the unittests), druntime, phobos
|
||||
build() {
|
||||
local unittest=${1:-1}
|
||||
if [ "$OS_NAME" != "windows" ]; then
|
||||
source ~/dlang/*/activate # activate host compiler, incl. setting `DMD`
|
||||
fi
|
||||
$DMD compiler/src/build.d -ofgenerated/build
|
||||
generated/build -j$N MODEL=$MODEL HOST_DMD=$DMD DFLAGS="$CI_DFLAGS" BUILD=debug unittest
|
||||
generated/build -j$N MODEL=$MODEL HOST_DMD=$DMD DFLAGS="$CI_DFLAGS" ENABLE_RELEASE=1 dmd
|
||||
if [ $unittest -eq 1 ]; then
|
||||
generated/build -j$N MODEL=$MODEL HOST_DMD=$DMD DFLAGS="$CI_DFLAGS" BUILD=debug unittest
|
||||
fi
|
||||
generated/build -j$N MODEL=$MODEL HOST_DMD=$DMD DFLAGS="$CI_DFLAGS" ENABLE_RELEASE=${ENABLE_RELEASE:-1} dmd
|
||||
make -j$N -C druntime MODEL=$MODEL
|
||||
make -j$N -C ../phobos MODEL=$MODEL
|
||||
if [ "$OS_NAME" != "windows" ]; then
|
||||
|
@ -249,7 +252,7 @@ if [ "$#" -gt 0 ]; then
|
|||
case $1 in
|
||||
install_host_compiler) install_host_compiler ;;
|
||||
setup_repos) setup_repos "$2" ;; # ci/run.sh setup_repos <git branch>
|
||||
build) build ;;
|
||||
build) build "${2:-}" ;; # ci/run.sh build [0] (use `0` to skip running compiler unittests)
|
||||
rebuild) rebuild "${2:-}" ;; # ci/run.sh rebuild [1] (use `1` to compare binaries to test reproducible build)
|
||||
test) test ;;
|
||||
test_dmd) test_dmd ;;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue