Skip to content

CI

CI #82

Workflow file for this run

# -*- coding: utf-8 -*-
#
# RERO-Invenio-Files
# Copyright (C) 2024 RERO.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
name: CI
on:
push:
branches:
- main
- staging
pull_request:
branches:
- main
- "staging"
schedule:
# * is a special character in YAML so you have to quote this string
- cron: "0 3 * * 6"
workflow_dispatch:
inputs:
reason:
description: "Reason"
required: false
default: "Manual trigger"
jobs:
Tests:
runs-on: ubuntu-latest
strategy:
matrix:
# TODO: You can add/remove combinations e.g. `dev` requirements or
# `postgresql13` by adding a new item to the following lists.
# You can see the complete list of services and versions that are available at:
# https://docker-services-cli.readthedocs.io/en/latest/configuration.html
python-version: ["3.9"]
db-service: [postgresql13]
search-service: [elasticsearch]
dependencies: ['dev', 'deploy']
env:
DB: ${{ matrix.db-service }}
SEARCH: ${{ matrix.search-service }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Update depencencies
if: ${{ matrix.dependencies == 'dev' }}
run: poetry update
- name: Install dependencies
run: |
poetry install
- name: Run tests
run: |
poetry run ./run-tests.sh
- name: Run build
run: poetry build