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
|
name: CI
on:
push:
branches:
- main
pull_request:
env:
DOCKER_REGISTRY: ghcr.io
DOCKER_IMAGE_NAME: ${{ github.repository }}
jobs:
standard:
name: Standard
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- uses: ./.github/setup
with:
python-version: ${{ matrix.python-version }}
- name: Update
run: ./scripts/update
- name: Test
run: ./scripts/test
extra-requires:
name: Extra requires
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- uses: ./.github/setup
with:
python-version: ${{ matrix.python-version }}
- name: Install with extra_requires
run: pip install .[s3,validate,dev]
- name: Test
run: ./scripts/test
minimum-versions:
name: Minimum versions
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- uses: ./.github/setup
with:
python-version: ${{ matrix.python-version }}
- name: Install the package
run: pip install .[dev]
- name: Install the minimum requirements
run: scripts/install-min-requirements
- name: Test
run: scripts/test
pre-release-versions:
name: Pre-release versions
runs-on: ubuntu-latest
continue-on-error: true
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- uses: ./.github/setup
with:
python-version: ${{ matrix.python-version }}
- name: Update
run: scripts/update
- name: Install pre-release versions of rasterio and pystac
run: pip install -U --pre pystac rasterio --no-binary rasterio
- name: Run tests
run: scripts/test
codecov:
name: Codecov
needs:
- standard
- extra-requires
- minimum-versions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Execute linters and test suites
run: ./docker/cibuild
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
fail_ci_if_error: false
docker:
name: Docker
needs:
- standard
- extra-requires
- minimum-versions
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta main
id: meta-main
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
- name: Build and push main
uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile
target: main
# Only push docker images if the event is a push to `main`
push: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
tags: ${{ steps.meta-main.outputs.tags }}
labels: ${{ steps.meta-main.outputs.labels }}
- name: Docker meta dev
id: meta-dev
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}
flavor: |
suffix=-dev
tags: |
type=ref,event=branch
type=ref,event=pr
- name: Build and push dev
uses: docker/build-push-action@v5
with:
context: .
file: docker/Dockerfile
target: dev
# Only push docker images if the event is a push to `main`
push: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
tags: ${{ steps.meta-dev.outputs.tags }}
labels: ${{ steps.meta-dev.outputs.labels }}
|