CI #1654
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
# Run on master, tags, or any pull request | |
on: | |
schedule: | |
- cron: '0 2 * * *' # Daily at 2 AM UTC (8 PM CST) | |
push: | |
branches: [master] | |
tags: ["*"] | |
pull_request: | |
env: | |
PGDATABASE: postgres | |
PGUSER: postgres | |
PGPASSWORD: root | |
jobs: | |
test: | |
name: Julia ${{ matrix.version }} - PostgreSQL ${{ matrix.postgresql-version }} - ${{ matrix.os }} - ${{ matrix.arch }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
version: | |
- "1" # Latest Release | |
postgresql-version: | |
- latest | |
os: | |
- ubuntu-latest | |
- windows-latest | |
arch: | |
- x64 | |
- x86 | |
macos-postgresql-path: | |
- /opt/homebrew/opt/postgresql | |
include: | |
# Add a LTS job just to make sure we still support it | |
- os: ubuntu-latest | |
version: "1.6" | |
arch: x64 | |
postgresql-version: latest | |
# Add older supported PostgreSQL Versions | |
- os: ubuntu-latest | |
version: 1 | |
arch: x64 | |
postgresql-version: '13' | |
- os: ubuntu-latest | |
version: 1 | |
arch: x64 | |
postgresql-version: '12' | |
- os: ubuntu-latest | |
version: 1 | |
arch: x64 | |
postgresql-version: '11' | |
- os: ubuntu-latest | |
version: 1 | |
arch: x64 | |
postgresql-version: '10' | |
- os: macOS-latest | |
version: 1 | |
arch: aarch64 | |
postgresql-version: '13' | |
macos-postgresql-path: /opt/homebrew/var/postgresql | |
- os: macOS-13 | |
version: 1 | |
arch: x64 | |
postgresql-version: '13' | |
macos-postgresql-path: /usr/local/var/postgresql | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: julia-actions/setup-julia@v1 | |
with: | |
version: ${{ matrix.version }} | |
arch: ${{ matrix.arch }} | |
- uses: actions/cache@v2 | |
env: | |
cache-name: cache-artifacts | |
with: | |
path: ~/.julia/artifacts | |
key: ${{ runner.os }}-${{ matrix.arch }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} | |
restore-keys: | | |
${{ runner.os }}-${{ matrix.arch }}-test-${{ env.cache-name }}- | |
${{ runner.os }}-${{ matrix.arch }}-test- | |
${{ runner.os }}-${{ matrix.arch }}- | |
${{ runner.os }}- | |
# Linux | |
- name: Install PostgreSQL | |
uses: harmon758/postgresql-action@v1 | |
if: ${{ runner.os == 'Linux' }} | |
with: | |
postgresql version: ${{ matrix.postgresql-version }} | |
postgresql user: ${{ env.PGUSER }} | |
postgresql password: ${{ env.PGPASSWORD }} | |
- name: Wait / Sleep | |
uses: jakejarvis/[email protected] | |
if: ${{ runner.os == 'Linux' }} | |
with: | |
time: '1m' | |
- name: Collect Docker Logs | |
uses: jwalton/[email protected] | |
if: ${{ runner.os == 'Linux' }} | |
- name: Check running containers | |
run: docker ps -a | |
if: ${{ runner.os == 'Linux' }} | |
- name: Set PGHOST on Linux | |
run: echo "PGHOST=localhost" >> $GITHUB_ENV | |
if: ${{ runner.os == 'Linux' }} | |
# MacOS | |
- name: Install PostgreSQL | |
run: brew install postgresql@${{ matrix.postgresql-version }} | |
if: ${{ runner.os == 'macOS' }} | |
- name: Add PostgreSQL to Path | |
run: echo "$(brew --prefix postgresql@${{matrix.postgresql-version }})/bin" >> $GITHUB_PATH | |
if: ${{ runner.os == 'macOS' }} | |
- name: Set PGUSER on macOS | |
run: | | |
echo "PGUSER=$USER" >> $GITHUB_ENV | |
echo "LIBPQJL_DATABASE_USER=$USER" >> $GITHUB_ENV | |
if: ${{ runner.os == 'macOS' }} | |
- name: Start Homebrew PostgreSQL service | |
run: pg_ctl -D ${{ matrix.macos-postgresql-path }}@${{ matrix.postgresql-version }} start | |
if: ${{ runner.os == 'macOS' }} | |
# Windows | |
- name: Add PostgreSQL to Path | |
run: | | |
echo $env:PGBIN | |
echo $env:PGBIN | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
if: ${{ runner.os == 'Windows' }} | |
- name: Start Windows PostgreSQL service | |
run: | | |
pg_ctl -D $env:PGDATA start | |
pg_ctl -D $env:PGDATA status | |
if: ${{ runner.os == 'Windows' }} | |
# Run Tests | |
- run: psql -c '\conninfo' | |
- uses: julia-actions/julia-buildpkg@latest | |
- uses: julia-actions/julia-runtest@latest | |
- uses: julia-actions/julia-processcoverage@v1 | |
- uses: codecov/codecov-action@v1 | |
with: | |
file: lcov.info | |
docs: | |
name: Documentation | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: julia-actions/setup-julia@v1 | |
with: | |
version: '1' | |
- name: Setup documentation dependencies | |
run: | | |
sudo apt-get update -y -qq | |
sudo apt-get install -y -qq fonts-lmodern pdf2svg texlive-latex-extra texlive-luatex texlive-pictures texlive-xetex | |
- uses: harmon758/postgresql-action@v1 | |
with: | |
postgresql version: latest | |
postgresql user: ${{ env.PGUSER }} | |
postgresql password: ${{ env.PGPASSWORD }} | |
- name: Wait / Sleep | |
uses: jakejarvis/[email protected] | |
with: | |
time: '1m' | |
- name: Collect Docker Logs | |
uses: jwalton/[email protected] | |
- name: Check running containers | |
run: docker ps -a | |
- name: Set PGHOST | |
run: echo "PGHOST=localhost" >> $GITHUB_ENV | |
- run: | | |
julia --project=docs -e ' | |
using Pkg | |
Pkg.develop(PackageSpec(path=pwd())) | |
Pkg.instantiate() | |
include("docs/make.jl")' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} | |
error-codes: | |
name: Error Codes | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: julia-actions/setup-julia@v1 | |
with: | |
version: '1' | |
- name: Install Julia packages | |
run: julia -e 'using Pkg; Pkg.add(["EzXML", "HTTP"]);' | |
- name: Generate error codes | |
run: julia deps/error_codes.jl error_codes_generated.jl | |
- name: Compare error codes | |
run: diff error_codes_generated.jl src/error_codes.jl |