summaryrefslogtreecommitdiff
path: root/.github/workflows/ci.yml
blob: fcaf23119968a697a9da85cce8fe271e42fec96c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Run Tests

on:
  push:
    branches:
      - '*'
  pull_request:

jobs:
  dist:
    name: Make distribution using Dist::Zilla
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2
      - name: Make distribution
        shell: bash
        run: |
          ./docker-run sh -c "
                dzil authordeps --missing | cpanm -n;
                dzil clean && dzil build --in build-dir"
      - name: Upload artifact
        uses: actions/upload-artifact@v2
        with:
          name: dist
          path: ./build-dir
  test:
    needs: dist
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [macos-latest, windows-latest, ubuntu-latest]
        perl: ['5']
        perl-threaded: [false]
        alien: [false, true]
        include:
          - { os: 'ubuntu-latest', perl: "5.14" }
          - { os: 'ubuntu-latest', perl: "5.16" }
          - { os: 'ubuntu-latest', perl: "5.20" }
          - { os: 'ubuntu-latest', perl: "5.30" }
          - { os: 'ubuntu-latest', perl: "5.32" }
          - { os: 'ubuntu-latest', perl: "5.32", perl-threaded: true }
    name: Perl ${{ matrix.perl }} on ${{ matrix.os }}, ${{ matrix.alien }}

    steps:
      - name: Get dist artifact
        uses: actions/download-artifact@v2
        with:
          name: dist

      - name: Set up perl
        uses: shogo82148/actions-setup-perl@v1
        if: matrix.os != 'windows-latest'
        with:
          perl-version: ${{ matrix.perl }}
          multi-thread: ${{ matrix.perl-threaded }}
      - name: Set up perl (Strawberry)
        uses: shogo82148/actions-setup-perl@v1
        if: matrix.os == 'windows-latest'
        with:
          distribution: 'strawberry'

      - run: perl -V

      - name: Set up ZeroMQ (homebrew)
        if: matrix.os == 'macos-latest' && ! matrix.alien
        run: |
          brew install zeromq

      - name: Set up ZeroMQ (vcpkg)
        if: matrix.os == 'windows-latest' && ! matrix.alien
        run: |
          vcpkg install zeromq:x64-windows
          copy C:/vcpkg/packages/zeromq_x64-windows/bin/libzmq*.dll libzmq.dll
          echo $pwd.Path | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

      - name: Install Alien::ZMQ::latest
        if: matrix.alien
        run: |
          cpanm -nq Alien::ZMQ::latest

      - name: Install Perl deps
        run: |
          cpanm --notest --installdeps .

      - name: Run tests
        run: |
          cpanm --verbose --test-only .