Create Clipping page, model, view and templates #88
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: CI pipeline | |
on: push | |
jobs: | |
linter: | |
name: run / linter | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code from Github | |
uses: actions/checkout@v3 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Installing flake8 | |
run: | | |
python -m pip install --upgrade pip | |
pip install flake8 | |
- name: Run flake8 linter | |
run: | | |
flake8 --max-line-length=200 --exclude=*/migrations src/ | |
build: | |
name: run / build | |
runs-on: ubuntu-latest | |
needs: linter | |
steps: | |
- name: Check out code from Github | |
uses: actions/checkout@v3 | |
- name: Build image | |
run: | | |
# docker login -u $DOCKER_HUB_USER -p $DOCKER_HUB_PASS | |
docker build . -t jandigarte/django:$GITHUB_SHA | |
docker save -o docker_image_$GITHUB_SHA jandigarte/django:$GITHUB_SHA | |
- name: Caching image | |
uses: actions/cache@v3 | |
with: | |
key: jandigarte | |
path: docker_image_${{ github.sha }} | |
migrations: | |
name: test / migrations | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Check out code from Github | |
uses: actions/checkout@v3 | |
- name: Restoring cached image | |
uses: actions/cache@v3 | |
with: | |
key: jandigarte | |
path: docker_image_${{ github.sha }} | |
- name: Running container | |
env: | |
IMAGE_NAME: jandigarte/django:${{ github.sha }} | |
run: | | |
cp .envs/.example .envs/.env | |
docker load -i docker_image_$GITHUB_SHA | |
docker-compose -f docker-compose.ci.yml -p jandigarte_$GITHUB_SHA up --no-build -d | |
- name: Test migrations | |
run: | | |
docker exec jandigarte_${{ github.sha }}_django_1 sh -c "\ | |
poetry run src/manage.py makemigrations --check --dry-run" | |
test: | |
name: test / unity | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Check out code from Github | |
uses: actions/checkout@v3 | |
- name: Restoring cached image | |
uses: actions/cache@v3 | |
with: | |
key: jandigarte | |
path: docker_image_${{ github.sha }} | |
- name: Running container | |
env: | |
IMAGE_NAME: jandigarte/django:${{ github.sha }} | |
run: | | |
cp .envs/.example .envs/.env | |
docker load -i docker_image_$GITHUB_SHA | |
docker-compose -f docker-compose.ci.yml -p jandigarte_$GITHUB_SHA up --no-build -d | |
- name: Running users tests | |
run: | | |
docker exec jandigarte_${{ github.sha }}_django_1 sh -c "\ | |
poetry run src/manage.py test" |