Skip to content

Build destination tiles concurrently #255

Build destination tiles concurrently

Build destination tiles concurrently #255

Workflow file for this run

name: CI
on:
push:
branches:
- main
tags: ['*']
pull_request:
workflow_dispatch:
concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
env:
# The regridding suite compares threaded weight assembly against serial,
# which only compares two things above one thread.
JULIA_NUM_THREADS: '2'
strategy:
fail-fast: false
matrix:
version:
- '1.11'
- '1.12'
os:
- ubuntu-latest
include:
- os: macos-latest
version: '1.12'
steps:
- uses: actions/checkout@v6
- uses: julia-actions/setup-julia@v3
with:
version: ${{ matrix.version }}
- uses: julia-actions/cache@v3
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- name: Test conformance package
if: matrix.version == '1.12'
run: julia --project=lib/DiscreteGlobalGridsConformanceTesting -e 'using Pkg; Pkg.test()'
- uses: julia-actions/julia-processcoverage@v1
with:
directories: src
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v7.0.0
with:
files: lcov.info
slug: JuliaGeo/DiscreteGlobalGrids.jl
conformance-fallbacks:
# The conformance suite's default mode tests what a system implemented; this
# runs the same laws against the generic fallbacks, which is what answers
# for a system that implemented none of them. It is its own job because the
# geometric adjacency costs a tree query and a boundary comparison per cell
# and has no business slowing the suite everything else waits on.
name: Conformance (generic fallbacks)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: julia-actions/setup-julia@v3
with:
version: '1.12'
- uses: julia-actions/cache@v3
- name: Certify the generic fallbacks
run: |
julia --project=lib/DiscreteGlobalGridsConformanceTesting -e 'using Pkg; Pkg.instantiate()'
julia --project=lib/DiscreteGlobalGridsConformanceTesting \
lib/DiscreteGlobalGridsConformanceTesting/test/generic_fallbacks.jl
docs:
name: Documentation
runs-on: ubuntu-latest
permissions:
contents: write
statuses: write
actions: write
pull-requests: write
steps:
# The hydrology tutorial's IGEO7 grid peaks past the runner's 16 GB: the
# Makie polygons and per-cell meshes behind its `poly` figures cost more
# than everything else on the page put together. /mnt is the runner's
# scratch disk and has the room for a swap file that covers the
# difference; the build is slower for it rather than smaller.
- name: Add swap space
run: |
set -x
free -h; swapon --show; df -h / /mnt || true
sudo swapoff -a
sudo rm -f /mnt/swapfile
dir=/mnt; [ -d "$dir" ] || dir=/var/tmp
# Leave a few GB on the disk for whatever else wants it.
avail=$(df -BG --output=avail "$dir" | tail -1 | tr -dc '0-9')
size=$(( avail > 26 ? 20 : avail - 6 ))
[ "$size" -ge 8 ] || { echo "only ${avail}G free on $dir"; exit 1; }
sudo fallocate -l "${size}G" "$dir/dgg-swapfile"
sudo chmod 600 "$dir/dgg-swapfile"
sudo mkswap "$dir/dgg-swapfile"
sudo swapon "$dir/dgg-swapfile"
# Nothing here benefits from cache retention; let anonymous pages go.
sudo sysctl vm.swappiness=100
free -h; swapon --show; df -h "$dir"
# Makie needs a GL stack and an X server even for CairoMakie-only builds,
# because GeoMakie/GLMakie may still be loaded by a doc page.
- name: Install binary dependencies
run: sudo apt-get update && sudo apt-get install -y xorg-dev mesa-utils xvfb libgl1 freeglut3-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev
- uses: actions/checkout@v6
- uses: julia-actions/setup-julia@v3
with:
version: '1'
- uses: julia-actions/cache@v3
- name: Install documentation dependencies
run: |
xvfb-run -s '-screen 0 1024x768x24' julia --project=docs -e '
using Pkg
Pkg.instantiate(; workspace = true)'
env:
DISPLAY: ':0'
DATADEPS_ALWAYS_ACCEPT: 'true'
- uses: julia-actions/julia-docdeploy@v1
with:
prefix: xvfb-run
install-package: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
DISPLAY: ':0'
DATADEPS_ALWAYS_ACCEPT: 'true'
- name: Memory and swap after the build
if: always()
run: |
free -h
swapon --show