Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI fixes #20

Merged
merged 3 commits into from
Mar 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 110 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,51 +11,137 @@ on:
# allow this workflow to be triggered manually

jobs:
test_asan:
name: 'Run unittests with AddressSanitizer'
asan:
name: '[ubuntu] ASan x86_64/ldc-latest'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
- name: Set up D compiler / tools
uses: dlang-community/setup-dlang@v1.1.0
uses: dlang-community/setup-dlang@763d869b4d67e50c3ccd142108c8bca2da9df166
with:
compiler: ldc-latest
- name: Cache dub dependencies
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed
with:
path: ~/.dub/packages
key: ubuntu-latest-build-${{ hashFiles('**/dub.sdl', '**/dub.json') }}
restore-keys: |
ubuntu-latest-build-
- name: Run unittests
run: |
dub test -c asan-unittest --compiler=ldc2
builder:
name: 'Build and test on ${{ matrix.arch }}-${{ matrix.os }}/${{ matrix.dc }}'
runs-on: ${{ matrix.os }}
continue-on-error: ${{ contains(matrix.dc, 'beta') }}

setup:
name: 'Load job configuration'
runs-on: ubuntu-latest
outputs:
compilers: ${{ steps.load-config.outputs.compilers }}
steps:
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
- id: load-config
run: |
echo "::set-output name=compilers::$(cat .github/workflows/compilers.json | jq -c -M)"

macos:
name: '[macos] x86_64/${{ matrix.dc }}'
runs-on: macos-latest
needs: setup
continue-on-error: ${{ contains(matrix.dc, 'beta') || contains(matrix.dc, 'master') }}
env:
ARCH: x86_64
strategy:
fail-fast: false
matrix:
dc: ${{ fromJSON(needs.setup.outputs.compilers) }}
steps:
- name: Checkout repo
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
with:
fetch-depth: 0
- name: Setup D compiler
uses: dlang-community/setup-dlang@763d869b4d67e50c3ccd142108c8bca2da9df166
with:
compiler: ${{ matrix.dc }}
- name: Cache dub dependencies
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed
with:
path: ~/.dub/packages
key: macos-latest-build-${{ hashFiles('**/dub.sdl', '**/dub.json') }}
restore-keys: |
macos-latest-build-
- name: Build / test
run: dub test --arch=$ARCH --build=unittest-cov
shell: bash
- name: Upload coverage data
uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b

ubuntu:
name: '[ubuntu] ${{ matrix.arch }}/${{ matrix.dc }}'
runs-on: ubuntu-latest
needs: setup
continue-on-error: ${{ contains(matrix.dc, 'beta') || contains(matrix.dc, 'master') }}
env:
ARCH: ${{ matrix.arch }}
strategy:
fail-fast: false
matrix:
dc: [ldc-latest, ldc-beta, dmd-latest, dmd-beta]
os: [ubuntu-latest, windows-latest]
dc: ${{ fromJSON(needs.setup.outputs.compilers) }}
arch: [x86, x86_64]
include:
- dc: ldc-latest
os: macos-latest
arch: x86_64
- dc: dmd-latest
os: macos-latest
arch: x86_64
steps:
- uses: actions/checkout@v2
- name: Checkout repo
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
with:
fetch-depth: 0
- uses: dlang-community/[email protected]
- name: Setup D compiler
uses: dlang-community/setup-dlang@763d869b4d67e50c3ccd142108c8bca2da9df166
with:
compiler: ${{ matrix.dc }}
- name: Install multi-lib for 32-bit systems
if: matrix.arch == 'x86' && matrix.os == 'ubuntu-latest'
if: matrix.arch == 'x86'
run: sudo apt-get update && sudo apt-get install gcc-multilib
- id: build
name: Test building
- name: Cache dub dependencies
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed
with:
path: ~/.dub/packages
key: ubuntu-latest-build-${{ hashFiles('**/dub.sdl', '**/dub.json') }}
restore-keys: |
ubuntu-latest-build-
- name: Build / test
run: dub test --arch=$ARCH --build=unittest-cov
shell: bash
- name: Upload coverage data
uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b

windows:
name: '[windows] x86_64/${{ matrix.dc }}'
runs-on: windows-latest
needs: setup
continue-on-error: ${{ contains(matrix.dc, 'beta') || contains(matrix.dc, 'master') }}
env:
ARCH: x86_64
strategy:
fail-fast: false
matrix:
dc: ${{ fromJSON(needs.setup.outputs.compilers) }}
steps:
- name: Checkout repo
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
with:
fetch-depth: 0
- name: Setup D compiler
uses: dlang-community/setup-dlang@763d869b4d67e50c3ccd142108c8bca2da9df166
with:
compiler: ${{ matrix.dc }}
- name: Cache dub dependencies
uses: actions/cache@937d24475381cd9c75ae6db12cb4e79714b926ed
with:
path: ~\AppData\Local\dub
key: windows-latest-build-${{ hashFiles('**/dub.sdl', '**/dub.json') }}
restore-keys: |
windows-latest-build-
- name: Build / test
run: dub test --arch=$ARCH --build=unittest-cov
shell: bash
- id: coverage
uses: codecov/codecov-action@v2
- name: Upload coverage data
uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b
10 changes: 10 additions & 0 deletions .github/workflows/compilers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
"dmd-master",
"dmd-latest",
"dmd-beta",
"dmd-2.098.1",
"ldc-master",
"ldc-latest",
"ldc-beta",
"ldc-1.28.1"
]