Skip to content

ci: update ci to Ubuntu 22.04 #554

ci: update ci to Ubuntu 22.04

ci: update ci to Ubuntu 22.04 #554

Workflow file for this run

name: Gnocchi
on:
workflow_dispatch:
inputs:
debug:
description: 'Enable debug'
required: false
default: false
type: boolean
pull_request:
# NOTE(tobias-urdin): If you change any jobs make sure to modify
# the Mergify.io config in .mergify.yml to include the jobs!
jobs:
doc:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
env:
- docs
- docs-gnocchi-web
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- run: sudo chown -R 1001:1001 $GITHUB_WORKSPACE
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
ci_image:
- 'images/Dockerfile.ci'
- 'images/entrypoint.sh.ci'
- uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
if: steps.changes.outputs.ci_image == 'false'
- run: docker pull ghcr.io/gnocchixyz/ci:latest
if: steps.changes.outputs.ci_image == 'false'
- uses: docker/build-push-action@v2
with:
context: ./images
file: ./images/Dockerfile.ci
push: false
tags: ghcr.io/gnocchixyz/ci:latest
if: steps.changes.outputs.ci_image == 'true'
- name: Set env vars
run: |
if [ "${{ github.event.inputs.debug }}" == "true" ]; then
echo "DOCKER_ENV_OPTS=-e GNOCCHI_TEST_DEBUG=1" >> $GITHUB_ENV
else
echo "DOCKER_ENV_OPTS=" >> $GITHUB_ENV
fi
- name: Run tests with tox in container
run: docker run --rm -v ${{ github.workspace }}:/github/workspace -w /github/workspace $DOCKER_ENV_OPTS ghcr.io/gnocchixyz/ci:latest "tox -e ${{ matrix.env }}"
check:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
env:
- build
- pep8
steps:
- uses: actions/checkout@v2
- run: sudo chown -R 1001:1001 $GITHUB_WORKSPACE
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
ci_image:
- 'images/Dockerfile.ci'
- 'images/entrypoint.sh.ci'
- uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
if: steps.changes.outputs.ci_image == 'false'
- run: docker pull ghcr.io/gnocchixyz/ci:latest
if: steps.changes.outputs.ci_image == 'false'
- uses: docker/build-push-action@v2
with:
context: ./images
file: ./images/Dockerfile.ci
push: false
tags: ghcr.io/gnocchixyz/ci:latest
if: steps.changes.outputs.ci_image == 'true'
- name: Set env vars
run: |
if [ "${{ github.event.inputs.debug }}" == "true" ]; then
echo "DOCKER_ENV_OPTS=-e GNOCCHI_TEST_DEBUG=1" >> $GITHUB_ENV
else
echo "DOCKER_ENV_OPTS=" >> $GITHUB_ENV
fi
- name: Run tests with tox in container
run: docker run --rm -v ${{ github.workspace }}:/github/workspace -w /github/workspace $DOCKER_ENV_OPTS ghcr.io/gnocchixyz/ci:latest "tox -e ${{ matrix.env }}"
test:
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
matrix:
python:
- py38
- py39
- py311
env:
- mysql-ceph-upgrade-from-4.4
- postgresql-file-upgrade-from-4.4
- mysql-file
- mysql-swift
- mysql-s3
- mysql-ceph
- postgresql-file
- postgresql-swift
- postgresql-s3
- postgresql-ceph
exclude:
- env: mysql-ceph-upgrade-from-4.4
python: py39
- env: mysql-ceph
python: py39
- env: postgresql-ceph
python: py39
- env: mysql-ceph-upgrade-from-4.4
python: py311
- env: mysql-ceph
python: py311
- env: postgresql-ceph
python: py311
steps:
- uses: actions/checkout@v2
- run: sudo chown -R 1001:1001 $GITHUB_WORKSPACE
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
ci_image:
- 'images/Dockerfile.ci'
- 'images/entrypoint.sh.ci'
- uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
if: steps.changes.outputs.ci_image == 'false'
- run: docker pull ghcr.io/gnocchixyz/ci:latest
if: steps.changes.outputs.ci_image == 'false'
- uses: docker/build-push-action@v2
with:
context: ./images
file: ./images/Dockerfile.ci
push: false
tags: ghcr.io/gnocchixyz/ci:latest
if: steps.changes.outputs.ci_image == 'true'
- name: Set env vars
run: |
if [ "${{ github.event.inputs.debug }}" == "true" ]; then
echo "DOCKER_ENV_OPTS=-e GNOCCHI_TEST_DEBUG=1" >> $GITHUB_ENV
else
echo "DOCKER_ENV_OPTS=" >> $GITHUB_ENV
fi
- name: Run tests with tox in container
run: docker run --rm -v ${{ github.workspace }}:/github/workspace -w /github/workspace $DOCKER_ENV_OPTS ghcr.io/gnocchixyz/ci:latest "tox -e ${{ matrix.python }}-${{ matrix.env }}"