aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows/default.yml
blob: c3becce85ce7bea9ba273bbfe7643a58fe58616c (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
name: CI

on: [push, pull_request]

jobs:
  test:
    name: Test on perl ${{ matrix.perl_version }}
    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      matrix:
        # stretch, buster, focal/bullseye, xenial, trusty
        # bionic 5.26 is ubuntu-latest, in coverage run
        perl_version: [ 5.24.4, 5.28.3, 5.30.3, 5.22.4, 5.18.4 ]

    steps:
    - uses: actions/checkout@v2
      with:
        submodules: true

    - name: Setup cache (carton)
      uses: actions/cache@v2
      with:
        path: local
        key: ${{ runner.os }}-perl-${{ matrix.perl_version }}-carton-${{ hashFiles('cpanfile.snapshot') }}

    - name: Setup cache (perl)
      id: cache-perl
      uses: actions/cache@v2
      with:
        path: ~/perl5
        key: ${{ runner.os }}-perl-${{ matrix.perl_version }}

    - name: Install correct perl
      if: steps.cache-perl.outputs.cache-hit != 'true'
      run: |
          wget -qO - https://install.perlbrew.pl | bash
          ~/perl5/perlbrew/bin/perlbrew install --notest ${{ matrix.perl_version }}
          ~/perl5/perlbrew/bin/perlbrew clean

    - name: Add packages
      run: |
        sudo apt install -y gettext language-pack-en language-pack-de language-pack-sv libimage-magick-perl
        ~/perl5/perlbrew/bin/perlbrew exec vendor/bin/carton install --deployment
        commonlib/bin/gettext-makemo FixMyStreet

    - name: Run tests
      run: ~/perl5/perlbrew/bin/perlbrew exec script/test --jobs 3 t