Skip to content

Commit

Permalink
Fix and improve the CI configuration
Browse files Browse the repository at this point in the history
- Fix a unittest that no longer compile by removing safe annotation;
- Properly pass the compiler parameter to the Github action installing it;
- Improve job definitions;
- Set up a periodic build to avoid breakage when no development happens;
  • Loading branch information
Geod24 committed Jan 24, 2025
1 parent 1924790 commit c3c7208
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,49 @@
name: CI

on: [ push, pull_request ]
on:
push:
branches:
- 'v*.*.x'
tags:
- 'v*'
pull_request:
branches:
- 'v*.*.x'
# Do a periodic build (every Monday at 0600) to ensure integrity
schedule:
- cron: '0 6 * * 1'

jobs:
build:
name: Run
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
dc: [ dmd-latest, ldc-latest, dmd-2.085.1, ldc-1.14.0 ]
include:
- { os: macos-latest, dc: ldc-latest }
- { os: ubuntu-latest, dc: dmd-latest }
- { os: ubuntu-latest, dc: ldc-latest }
- { os: windows-latest, dc: dmd-latest }
- { os: windows-latest, dc: ldc-latest }

runs-on: ${{ matrix.os }}
timeout-minutes: 40

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
# Requiried for codecov action
fetch-depth: 2
- uses: dlang-community/setup-dlang@v1
with:
compiler: ${{ matrix.dc }}

- name: 'Build & Test'
shell: bash
run: |
dub test --compiler=$DC -b unittest-cov
dub test -b unittest-cov
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v4
with:
flags: unittests

0 comments on commit c3c7208

Please sign in to comment.