Skip to content

test

test #6

Workflow file for this run

name: Run test suite
on:
push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Calculate apt sources hash
id: apt-cache
run: |
echo -n hash= >> $GITHUB_OUTPUT
tar -cf - --sort=name /var/lib/apt/lists | sha256sum | cut -f 1 -d ' ' >> $GITHUB_OUTPUT
- name: Restore apt archives
uses: actions/cache/restore@v3
with:
path: apt-archives
key: ${{ env.ImageOS }}-apt-${{ steps.apt-cache.outputs.hash }}
restore-keys: |
${{ env.ImageOS }}-apt-
- name: Install OS dependencies
run: |
sudo mkdir -p /etc/postgresql-common/createcluster.d/
echo "create_main_cluster = false" | \
sudo tee /etc/postgresql-common/createcluster.d/override.conf
#sudo rm /etc/apt/apt.conf.d/docker-clean
mkdir -p apt-archives
sudo mkdir -p /var/cache/apt
sudo cp -a apt-archives /var/cache/apt/archives
#sudo apt-get update
sudo apt-get install -y python3-dev postgresql
cp -a /var/cache/apt/archives/*.deb apt-archives
- name: Save apt archives
uses: actions/cache/save@v3
with:
path: apt-archives
key: ${{ env.ImageOS }}-apt-${{ steps.apt-cache.outputs.hash }}
- name: Get pip cache dir
id: pip-cache
run: |
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt', 'requirements_test.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install OS dependencies
run: |
echo "$HOME/.local/bin" >> $GITHUB_PATH
pip install -r requirements.txt -r requirements_test.txt
- run: pytest