ArtemIsmagilov is testing out GitHub Actions 🚀 #42
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
name: GitHub Actions Demo | |
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 | |
on: [ push ] | |
jobs: | |
Explore-GitHub-Actions: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [ "3.12" ] | |
steps: | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- shell: 'script --return --quiet --log-out /dev/null --command "bash -e {0}"' | |
run: | | |
# install depends | |
pip install -r requirements-test.txt | |
# linting | |
ruff check | |
ruff format --check | |
# start databases | |
cd movie_service/ | |
docker compose -f compose-local.yaml up -d | |
until curl --output /dev/null --silent --head --fail http://127.0.0.1:9200; do | |
printf '.' | |
sleep 5 | |
done | |
# init indexes | |
bash scripts/init_schema_es.bash | |
# migrate data to elastic | |
cd etl/ | |
python -m etl.etl_single_migrate | |
docker compose down postgres-local | |
cd ../../ | |
# testing | |
pytest -sv | |
# flush all data from cache | |
docker exec -it redis-local sh -c "redis-cli FLUSHALL" | |
# test coverage | |
coverage run -m pytest | |
coverage report -m | |
- name: List files in the repository | |
run: | | |
ls ${{ github.workspace }} | |
- run: echo "🍏 This job's status is ${{ job.status }}." |