adamdruppe / arsd

This is a collection of modules that I've released over the years. Most of them stand alone, or have just one or two dependencies in here, so you don't have to download this whole repo.
http://arsd-official.dpldocs.info/arsd.html
531 stars 128 forks source link

Github actions #240

Open andre2007 opened 4 years ago

andre2007 commented 4 years ago

By adding a file .github/workflows/test.yml with this content

name: Run all D Tests
on: [push, pull_request]

jobs:
    test:
        name: Dub Tests
        strategy:
            matrix:
                os: [ubuntu-latest, windows-latest, macOS-latest]
                dc: [dmd-latest, ldc-latest]
        runs-on: ${{ matrix.os }}
        steps:
            - uses: actions/checkout@v1

            - name: Install D compiler
              uses: mihails-strasuns/setup-dlang@v0.3.0
              with:
                  compiler: ${{ matrix.dc }}

            - name: Run tests
              run: dub test -b syntax

there will be a pull request voter, checking the syntax of the dub sub packages specified here https://github.com/adamdruppe/arsd/blob/master/dub.json#L9

The syntax is checked on windows, linux and macos. (One thing is missing, it only test x86_64 architecture, as this is now Dub default for all OS)

It only checks the syntax because the sub packages might have additional system dependencies which causes linker failures.

adamdruppe commented 4 years ago

so with these they don't run until after it is pushed... i have a test system here i just often forget to run it. but it would be be good to check it before the push more consistently.

maybe i should just hook the git push command in that directory to do the test thing first.

andre2007 commented 4 years ago

The tests runs on each pull request and on merge to master. Even if the tests fail you can still merge.

The tests for the master merge are interesting, because github provide you badges, which you can embed in the markdowns readme.

adamdruppe commented 4 years ago

On Wed, Feb 12, 2020 at 07:54:26AM -0800, andre2007 wrote:

The tests runs on each pull request and on merge to master. Even if the tests fail you can still merge.

yeah just like once i push it here it is already "released" so a bit late to test.

but better late then never perhaps. i'll play with it tomorrow...

andre2007 commented 4 years ago

I just noticed you are pushing directly to master. Therefore I understand now what you mean with too late to test. Yes, pull request voter is most useful if master branch is write protected and can only be updated by pull request merge.

adamdruppe commented 4 years ago

Yeah, I don't use branches at all on this code. It really is just a directory of files on my computer that i periodically git commit -a -m "stuff"; git push to share with other people.