Unit & Integration Tests #653
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Unit & Integration Tests | |
# env: | |
# DISABLED_SCRAPPERS: BAREKET | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
schedule: | |
# * is a special character in YAML so you have to quote this string | |
- cron: '00 17 * * *' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: self-hosted | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.11.0"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Free disk space | |
run: | | |
df --human-readable | |
sudo apt clean | |
docker 2>/dev/null 1>&2 rmi $(docker image ls --all --quiet) || true | |
rm --recursive --force "$AGENT_TOOLSDIRECTORY" | |
df --human-readable | |
- name: Build with Docker | |
run: docker build -t erlichsefi/israeli-supermarket-scarpers:test --target test . | |
- name: Remove all build | |
run: (docker stop scraper-test-run 2>/dev/null || true) && (docker rm scraper-test-run 2>/dev/null || true) | |
- name: Test with pytest | |
run: docker run --rm --name scraper-test-run -e DISABLED_SCRAPPERS="${{ env.DISABLED_SCRAPPERS }}" erlichsefi/israeli-supermarket-scarpers:test && | |
docker builder prune -f |