From f69e90a7f18438de1eeb61b394290c3e5cd158a0 Mon Sep 17 00:00:00 2001 From: Evan Blaudy Date: Tue, 12 Sep 2023 13:18:39 +0200 Subject: [PATCH] [github-actions] do tests on github-actions --- .github/workflows/ci.yml | 56 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..788050d0e0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,56 @@ +--- +name: Zou CI + +on: + pull_request: + branches: + - master + push: + branches: + - master + +jobs: + ci: + name: Test with different versions of Python ๐Ÿ + runs-on: ubuntu-22.04 + env: + INDEXER_KEY: "testkey0123456789" + strategy: + matrix: + version: [3.8, 3.11] + container: ${{ matrix.container }} + services: + postgres: + image: postgres + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + env: + POSTGRES_PASSWORD: postgres + POSTGRES_PORT: 5432 + steps: + - uses: actions/checkout@v3 + - name: Install ffmpeg + run: sudo apt-get install -y ffmpeg + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.version }} + - name: Upgrade pip ๐Ÿ“ฆ + run: >- + pip install --upgrade pip setuptools + - name: Install packages ๐Ÿ“ฆ + run: >- + pip install -r requirements.txt + - name: Create database ๐Ÿ—„ + run: >- + PGPASWORD=postgres psql -c 'create database zoudb;' -U postgres -h 127.0.0.1 -p 5432 + - name: Launch docker for meilisearch ๐Ÿณ + run: | + docker pull getmeili/meilisearch:v1.1 + docker run -it --rm -d -p 7700:7700 -e MEILI_MASTER_KEY=$INDEXER_KEY getmeili/meilisearch:v1.1 + - name: Run tests ๐Ÿงช + run: >- + py.test