File: ci.yml

package info (click to toggle)
pg-ldap-sync 0.5.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 164 kB
  • sloc: ruby: 424; makefile: 4
file content (94 lines) | stat: -rw-r--r-- 3,276 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
name: CI

on:
  workflow_dispatch:
  schedule:
    - cron: "0 1 2 * *" # At 01:00 on the second day of each month - https://crontab.guru/#0_1_2_*_*
  push:
    branches:
      - master
    tags:
      - "*.*.*"
  pull_request:
    types: [opened, synchronize]
    branches:
      - "*"

jobs:
  job_test_gem:
    name: Test built gem
    strategy:
      fail-fast: false
      matrix:
        include:
          - os: windows
            ruby: "head"
            PGVERSION: 18.0-1-windows-x64
            PGVER: "18"
          - os: windows
            ruby: "2.4"
            PGVERSION: 9.4.26-1-windows-x64
            PGVER: "9.4"
          - os: ubuntu
            ruby: "head"
            PGVER: "18"
          - os: ubuntu
            os_ver: "22.04"
            ruby: "2.3"
            PGVER: "9.3"
          - os: macos
            ruby: "head"
            PGVERSION: 17.6-1-osx
            PGVER: "17"

    runs-on: ${{ matrix.os }}-${{ matrix.os_ver || 'latest' }}
    env:
      PGVERSION: ${{ matrix.PGVERSION }}
      PGVER: ${{ matrix.PGVER }}

    steps:
      - uses: actions/checkout@v3
      - name: Set up Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: ${{ matrix.ruby }}

      - name: Download PostgreSQL Windows
        if: matrix.os == 'windows'
        run: |
          Add-Type -AssemblyName System.IO.Compression.FileSystem
          function Unzip {
              param([string]$zipfile, [string]$outpath)
              [System.IO.Compression.ZipFile]::ExtractToDirectory($zipfile, $outpath)
          }

          $(new-object net.webclient).DownloadFile("http://get.enterprisedb.com/postgresql/postgresql-$env:PGVERSION-binaries.zip", "postgresql-binaries.zip")
          Unzip "postgresql-binaries.zip" "."
          echo "$env:RI_DEVKIT$env:MINGW_PREFIX/bin;$env:RI_DEVKIT/usr/bin;$pwd/pgsql/bin"  | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
          echo "PGUSER=$env:USERNAME"  | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
          echo "PGPASSWORD="  | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
          md temp
          icacls temp /grant "Everyone:(OI)(CI)F" /T

      - name: Download PostgreSQL Ubuntu
        if: matrix.os == 'ubuntu'
        run: |
          echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main $PGVER" | sudo tee -a /etc/apt/sources.list.d/pgdg.list
          wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
          sudo apt-get -y update
          sudo apt-get -y --allow-downgrades install postgresql-$PGVER libpq5=$PGVER* libpq-dev=$PGVER*
          echo /usr/lib/postgresql/$PGVER/bin >> $GITHUB_PATH

      - name: Download PostgreSQL Macos
        if: matrix.os == 'macos'
        run: |
          wget https://get.enterprisedb.com/postgresql/postgresql-$PGVERSION-binaries.zip && \
          sudo mkdir -p /Library/PostgreSQL && \
          sudo unzip postgresql-$PGVERSION-binaries.zip -d /Library/PostgreSQL/$PGVER && \
          sudo mv /Library/PostgreSQL/$PGVER/pgsql/* /Library/PostgreSQL/$PGVER/ && \
          echo /Library/PostgreSQL/$PGVER/bin >> $GITHUB_PATH

      - run: bundle install

      - name: Run specs
        run: bundle exec rake test