aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/test.yml
blob: 0c6053158c931488b9b2f9aa9bf2bccf80603708 (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: CI

on: [push, pull_request]

jobs:
  test:
    name: >-
      ${{ matrix.os }} ${{ matrix.ruby }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ ubuntu-latest, macos-latest ]
        ruby: [ head, 2.7, 2.6, 2.5, 2.4, 2.3 ]
    steps:
      - name: repo checkout
        uses: actions/checkout@v2

      - name: load ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}

      - name: depends
        run:  rake install_dependencies

      - name: compile
        run:  rake compile -- --enable-debug

      - name: test
        run:  rake test TESTOPTS="-v --no-show-detail-immediately" OSSL_MDEBUG=1

  test-windows:
    name: >-
      ${{ matrix.os }} ${{ matrix.ruby }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ windows-latest ]
        ruby: [ mswin, mingw, 2.7, 2.6, 2.5, 2.4, 2.3 ]
    steps:
      - name: repo checkout
        uses: actions/checkout@v2

      - name: load ruby, install/update gcc, install openssl
        uses: MSP-Greg/setup-ruby-pkgs@v1
        with:
          ruby-version: ${{ matrix.ruby }}
          mingw: _upgrade_ openssl

      - name: depends
        run:  rake install_dependencies

      # SSL_DIR is set as needed by MSP-Greg/setup-ruby-pkgs
      # only used with mswin
      - name: compile
        run:  rake compile -- --enable-debug $env:SSL_DIR

      - name: test
        run:  rake test TESTOPTS="-v --no-show-detail-immediately" OSSL_MDEBUG=1

  test-openssls:
    name: >-
      ${{ matrix.openssl }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ ubuntu-latest ]
        ruby: [ 2.7 ]
        openssl:
          - openssl-1.0.1u # EOL
          - openssl-1.0.2u # EOL
          - openssl-1.1.0l # EOL
          - openssl-1.1.1d
          # - libressl-2.3.7 # EOL
          # - libressl-2.4.5 # EOL
          # - libressl-2.5.5 # EOL
          # - libressl-2.6.5 # EOL
          - libressl-2.7.5 # EOL
          - libressl-2.8.3 # EOL
          - libressl-2.9.2
          - libressl-3.0.2
    steps:
      - name: repo checkout
        uses: actions/checkout@v2

      - name: prepare openssl
        run: |
          mkdir -p tmp/build-openssl && cd tmp/build-openssl
          case ${{ matrix.openssl }} in
          openssl-*)
            curl -OL https://ftp.openssl.org/source/${{ matrix.openssl }}.tar.gz
            tar xf ${{ matrix.openssl }}.tar.gz && cd ${{ matrix.openssl }}
            # shared is required for 1.0.x.
            ./Configure --prefix=$HOME/.openssl/${{ matrix.openssl }} \
                shared linux-x86_64
            make depend
            ;;
          libressl-*)
            curl -OL https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/${{ matrix.openssl }}.tar.gz
            tar xf ${{ matrix.openssl }}.tar.gz && cd ${{ matrix.openssl }}
            ./configure --prefix=$HOME/.openssl/${{ matrix.openssl }}
            ;;
          *)
            false
            ;;
          esac
          make -j4
          make install_sw

      - name: load ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}

      - name: depends
        run:  rake install_dependencies

      - name: compile
        run:  rake compile -- --enable-debug --with-openssl-dir=$HOME/.openssl/${{ matrix.openssl }}

      - name: test
        run:  rake test TESTOPTS="-v --no-show-detail-immediately" OSSL_MDEBUG=1