Skip to content

Commit

Permalink
Make shell configurable in CI scripts, to later enable re-using same …
Browse files Browse the repository at this point in the history
…scripts for Alpine musl CI.
  • Loading branch information
JohanEngelen committed Jul 12, 2024
1 parent 800b775 commit 87e2034
Show file tree
Hide file tree
Showing 12 changed files with 69 additions and 26 deletions.
8 changes: 6 additions & 2 deletions .github/actions/2-build-bootstrap/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ inputs:
default: ''
arch:
required: false # Windows only
shell:
required: false
default: bash
runs:
using: composite
steps:

- name: Check CMake and ninja versions
shell: bash
shell: ${{ inputs.shell }}
run: |
set -eux
cmake --version
Expand All @@ -25,6 +28,7 @@ runs:
-DBUILD_SHARED_LIBS=OFF
${{ inputs.cmake_flags }}
arch: ${{ inputs.arch }}
shell: ${{ inputs.shell }}

- run: ../bootstrap-ldc/bin/ldc2 --version
shell: bash
shell: ${{ inputs.shell }}
6 changes: 5 additions & 1 deletion .github/actions/2a-build-pgo/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ inputs:
default: ''
arch:
required: false # Windows only
shell:
required: false
default: bash
runs:
using: composite
steps:
Expand All @@ -20,11 +23,12 @@ runs:
"-DDFLAGS_LDC=-fprofile-generate -vp-counters-per-site=1.5"
${{ inputs.cmake_flags }}
arch: ${{ inputs.arch }}
shell: ${{ inputs.shell }}
env:
LLVM_PROFILE_FILE: ${{ github.workspace }}/../pgo-ldc/%p.profraw

- name: Merge PGO profiles # to ../pgo-ldc/merged.profdata
shell: bash
shell: ${{ inputs.shell }}
run: |
set -eux
cd ../pgo-ldc
Expand Down
8 changes: 7 additions & 1 deletion .github/actions/3-build-native/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,18 @@ inputs:
with_pgo:
required: false
default: false
shell:
required: false
default: bash
runs:
using: composite
steps:

- name: 'Posix: Build mimalloc'
if: runner.os != 'Windows'
uses: ./.github/actions/helper-mimalloc
with:
shell: ${{ inputs.shell }}

- name: Build LDC & LDC D unittests & defaultlib unittest runners
uses: ./.github/actions/helper-build-ldc
Expand All @@ -28,6 +33,7 @@ runs:
${{ inputs.with_pgo == 'true' && '-DDFLAGS_LDC=-fprofile-use=../pgo-ldc/merged.profdata' || '' }}
build_targets: all ldc2-unittest all-test-runners
arch: ${{ inputs.arch }}
shell: ${{ inputs.shell }}

- run: ../build/bin/ldc2 --version
shell: bash
shell: ${{ inputs.shell }}
6 changes: 5 additions & 1 deletion .github/actions/4a-test-ldc2/action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Run LDC D unittests
inputs:
shell:
required: false
default: bash
runs:
using: composite
steps:
- run: cd ../build && ctest --output-on-failure -R "ldc2-unittest"
shell: bash
shell: ${{ inputs.shell }}
5 changes: 4 additions & 1 deletion .github/actions/4b-test-lit/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ name: Run LIT testsuite
inputs:
arch:
required: false # Windows only
shell:
required: false
default: bash
runs:
using: composite
steps:

- name: 'Posix: Run LIT testsuite'
if: runner.os != 'Windows'
shell: bash
shell: ${{ inputs.shell }}
# temporarily add LLVM bin dir to PATH, so that e.g. wasm-ld is found
run: cd ../build && PATH="$PWD/../llvm/bin:$PATH" ctest -V -R "lit-tests"

Expand Down
5 changes: 4 additions & 1 deletion .github/actions/4c-test-dmd/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ name: Run DMD testsuite
inputs:
arch:
required: false # Windows only
shell:
required: false
default: bash
runs:
using: composite
steps:

- name: 'Posix: Run DMD testsuite'
if: runner.os != 'Windows'
shell: bash
shell: ${{ inputs.shell }}
run: cd ../build && ctest -V -R "dmd-testsuite"

- name: 'Windows: Run DMD testsuite'
Expand Down
5 changes: 4 additions & 1 deletion .github/actions/4d-test-libs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ name: Run defaultlib unittests & druntime integration tests
inputs:
arch:
required: false # Windows only
shell:
required: false
default: bash
runs:
using: composite
steps:

- name: 'Posix: Run defaultlib unittests & druntime integration tests'
if: runner.os != 'Windows'
shell: bash
shell: ${{ inputs.shell }}
run: |
set -eux
cd ../build
Expand Down
11 changes: 7 additions & 4 deletions .github/actions/5-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ inputs:
cross_compiling:
required: false
default: false
shell:
required: false
default: bash
runs:
using: composite
steps:

- name: Install LDC
shell: bash
shell: ${{ inputs.shell }}
run: |
set -eux
cd ..
Expand Down Expand Up @@ -44,7 +47,7 @@ runs:
fi
- name: Make portable
shell: bash
shell: ${{ inputs.shell }}
run: |
set -eux
cd ..
Expand All @@ -57,12 +60,12 @@ runs:
cat install/etc/ldc2.conf
- name: Rename the installation dir to test portability
shell: bash
shell: ${{ inputs.shell }}
run: mv ../install ../installed

- name: 'Windows: Copy curl & MinGW-w64-based libs'
if: runner.os == 'Windows'
shell: bash
shell: ${{ inputs.shell }}
run: |
set -eux
cd ..
Expand Down
14 changes: 9 additions & 5 deletions .github/actions/6-integration-test/action.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
name: Run a few integration tests against the installed compiler
inputs:
shell:
required: false
default: bash
runs:
using: composite
steps:

- name: Generate hello.d
shell: bash
shell: ${{ inputs.shell }}
run: echo 'void main() { import std.stdio; writefln("Hello world, %d bits", size_t.sizeof * 8); }' > ../hello.d

- name: Run hello-world integration test with shared libs
shell: bash
shell: ${{ inputs.shell }}
run: |
set -eux
cd ..
Expand All @@ -24,7 +28,7 @@ runs:
fi
- name: Run hello-world integration test with LTO
shell: bash
shell: ${{ inputs.shell }}
run: |
set -eux
cd ..
Expand All @@ -40,7 +44,7 @@ runs:
- name: Run dynamic-compile integration test
# disabled since LLVM 12, needs https://github.com/ldc-developers/ldc/pull/3184
if: '!always()'
shell: bash
shell: ${{ inputs.shell }}
run: |
set -eux
cd ..
Expand All @@ -51,7 +55,7 @@ runs:
installed/bin/ldc2 -enable-dynamic-compile -run ldc/tests/dynamiccompile/array.d
- name: Run ImportC integration test
shell: bash
shell: ${{ inputs.shell }}
run: |
set -eux
cd ..
Expand Down
17 changes: 10 additions & 7 deletions .github/actions/7-package/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ inputs:
cross_target_triple:
required: false
default: ''
shell:
required: false
default: bash
runs:
using: composite
steps:

- name: Set DMD environment variable
shell: bash
shell: ${{ inputs.shell }}
run: |
set -eux
cd ..
Expand All @@ -25,7 +28,7 @@ runs:
echo "DMD=$DMD" >> $GITHUB_ENV
- name: Build & copy dub
shell: bash
shell: ${{ inputs.shell }}
run: |
set -eux
cd ..
Expand All @@ -41,7 +44,7 @@ runs:
fi
- name: Build & copy dlang tools
shell: bash
shell: ${{ inputs.shell }}
run: |
set -eux
cd ..
Expand All @@ -56,7 +59,7 @@ runs:
cp bin/{rdmd,ddemangle,dustmite} ../installed/bin/
- name: Build & copy reggae
shell: bash
shell: ${{ inputs.shell }}
run: |
set -eux
cd ..
Expand Down Expand Up @@ -84,7 +87,7 @@ runs:
fi
- name: Pack installation dir
shell: bash
shell: ${{ inputs.shell }}
run: |
set -euxo pipefail
cd ..
Expand Down Expand Up @@ -132,7 +135,7 @@ runs:
- name: 'Linux: Pack source dir'
if: runner.os == 'Linux' && inputs.os == ''
shell: bash
shell: ${{ inputs.shell }}
run: |
set -eux
git clean -dffx
Expand All @@ -146,7 +149,7 @@ runs:
zip -r -9 artifacts/$artifactName.zip $artifactName >/dev/null
- name: 'Move artifacts dir for uploading'
shell: bash
shell: ${{ inputs.shell }}
run: mv ../artifacts ./

- name: Upload artifact(s)
Expand Down
5 changes: 4 additions & 1 deletion .github/actions/helper-build-ldc/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@ inputs:
default: 'all'
arch:
required: false # Windows only
shell:
required: false
default: bash
runs:
using: composite
steps:

- if: runner.os != 'Windows'
shell: bash
shell: ${{ inputs.shell }}
run: |
set -eux
cd ..
Expand Down
5 changes: 4 additions & 1 deletion .github/actions/helper-mimalloc/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ inputs:
cmake_flags:
required: false
default: ''
shell:
required: false
default: bash
runs:
using: composite
steps:
- shell: bash
- shell: ${{ inputs.shell }}
run: |
set -eux
cd ..
Expand Down

0 comments on commit 87e2034

Please sign in to comment.