File: ci.yml

package info (click to toggle)
ruby-mini-portile2 2.8.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 336 kB
  • sloc: ruby: 1,838; ansic: 38; sh: 8; makefile: 4
file content (165 lines) | stat: -rw-r--r-- 5,427 bytes parent folder | download
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: ci
concurrency:
  group: "${{github.workflow}}-${{github.ref}}"
  cancel-in-progress: true
on:
  workflow_dispatch:
  push:
    branches:
      - main
      - v*.*.x
    tags:
      - v*.*.*
  pull_request:
    types: [opened, synchronize]
    branches:
      - "*"
  schedule:
    - cron: "0 8 * * 5" # At 08:00 on Friday # https://crontab.guru/#0_8_*_*_5

jobs:
  test-unit:
    env:
      MAKEFLAGS: -j2
    strategy:
      fail-fast: false
      matrix:
        platform: [ubuntu-latest, windows-latest, macos-latest]
        ruby: ["2.3", "2.4", "2.5", "2.6", "2.7", "3.0", "3.1", "3.2", "3.3", "3.4"]
        exclude:
          # I can't figure out how to install these on macos through setup-ruby
          - ruby: "2.3"
            platform: "macos-latest"
          - ruby: "2.4"
            platform: "macos-latest"
          - ruby: "2.5"
            platform: "macos-latest"
    runs-on: ${{ matrix.platform }}
    steps:
      - name: configure git crlf on windows
        if: matrix.platform == 'windows-latest'
        run: |
          git config --system core.autocrlf false
          git config --system core.eol lf
      - uses: actions/checkout@v4
      - uses: MSP-Greg/setup-ruby-pkgs@v1
        with:
          apt-get: _update_ build-essential cmake
          mingw: _upgrade_ cmake
          ruby-version: ${{ matrix.ruby }}
          bundler-cache: true
      - run: bundle exec rake test:unit

  test-examples:
    env:
      MAKEFLAGS: -j2
      LDFLAGS: "-L/usr/local/opt/libiconv/lib" # for macos-13, sigh
    strategy:
      fail-fast: false
      matrix:
        # use macos-13 (not 14) because libyaml 0.2.5 doesn't have up-to-date config.guess and config.sub
        platform: [ubuntu-latest, windows-latest, macos-13]
        ruby: ["3.1"]
    runs-on: ${{ matrix.platform }}
    steps:
      - name: configure git crlf on windows
        if: matrix.platform == 'windows-latest'
        run: |
          git config --system core.autocrlf false
          git config --system core.eol lf
      - uses: actions/checkout@v4
      - uses: MSP-Greg/setup-ruby-pkgs@v1
        with:
          apt-get: _update_ build-essential cmake
          mingw: _upgrade_ cmake
          brew: libiconv
          ruby-version: ${{ matrix.ruby }}
          bundler-cache: true
      - uses: actions/cache@v4
        with:
          path: examples/ports/archives
          key: examples-${{ hashFiles('examples/Rakefile') }}
      - run: bundle exec rake test:examples

  fedora: # see https://github.com/flavorjones/mini_portile/issues/118
    strategy:
      fail-fast: false
      matrix:
        task: ["test:unit", "test:examples"]
    runs-on: ubuntu-latest
    container:
      image: fedora:35
    steps:
      - run: |
          dnf group install -y "C Development Tools and Libraries"
          dnf install -y ruby ruby-devel libyaml-devel git-all patch cmake xz
      - uses: actions/checkout@v4
      - uses: actions/cache@v4
        with:
          path: examples/ports/archives
          key: examples-${{ hashFiles('examples/Rakefile') }}
      - run: bundle install
      - run: bundle exec rake ${{ matrix.task }}

  freebsd:
    strategy:
      fail-fast: false
      matrix:
        task: ["test:unit", "test:examples"]
    runs-on: ubuntu-latest
    env:
      MAKE: gmake
    steps:
      - uses: actions/checkout@v4
      - uses: actions/cache@v4
        with:
          path: examples/ports/archives
          key: examples-${{ hashFiles('examples/Rakefile') }}
      - uses: vmactions/freebsd-vm@v1
        with:
          envs: MAKE
          usesh: true
          copyback: false
          prepare: pkg install -y ruby devel/ruby-gems pkgconf git cmake devel/gmake textproc/libyaml security/gnupg
          run: |
            git config --global --add safe.directory /home/runner/work/mini_portile/mini_portile
            gem install bundler
            bundle install
            bundle exec rake ${{ matrix.task }}

  openbsd:
    strategy:
      fail-fast: false
      matrix:
        task: ["test:unit", "test:examples"]
    runs-on: ubuntu-latest
    env:
      MAKE: gmake
    steps:
    - uses: actions/checkout@v4
    - uses: vmactions/openbsd-vm@v1
      with:
        envs: MAKE
        usesh: true
        copyback: false
        prepare: |
          pkg_add ruby%3.4 gmake cmake git pkgconf security/gnupg
          ln -sf /usr/local/bin/ruby34 /usr/local/bin/ruby
          ln -sf /usr/local/bin/bundle34 /usr/local/bin/bundle
          ln -sf /usr/local/bin/bundler34 /usr/local/bin/bundler
          ln -sf /usr/local/bin/erb34 /usr/local/bin/erb
          ln -sf /usr/local/bin/gem34 /usr/local/bin/gem
          ln -sf /usr/local/bin/irb34 /usr/local/bin/irb
          ln -sf /usr/local/bin/racc34 /usr/local/bin/racc
          ln -sf /usr/local/bin/rake34 /usr/local/bin/rake
          ln -sf /usr/local/bin/rbs34 /usr/local/bin/rbs
          ln -sf /usr/local/bin/rdbg34 /usr/local/bin/rdbg
          ln -sf /usr/local/bin/rdoc34 /usr/local/bin/rdoc
          ln -sf /usr/local/bin/ri34 /usr/local/bin/ri
          ln -sf /usr/local/bin/syntax_suggest34 /usr/local/bin/syntax_suggest
          ln -sf /usr/local/bin/typeprof34 /usr/local/bin/typeprof
        run: |
          git config --global --add safe.directory /home/runner/work/mini_portile/mini_portile
          gem install bundler
          bundle install
          bundle exec rake ${{ matrix.task }}