Merge pull request #9 from FilGoodInc/compressed_oxygencs #10
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: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test_integration: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
- name: Install dependencies | |
run: | | |
pip install pipenv | |
pipenv install --dev | |
- name: Run integration tests | |
run: pipenv run pytest test/test_integration.py | |
lint_and_format: | |
runs-on: ubuntu-latest | |
needs: test_integration | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
- name: Install dependencies | |
run: | | |
pip install pipenv | |
pipenv install --dev | |
pip install black pylint | |
- name: Run linting | |
run: pipenv run pylint src/*.py | |
- name: Run formatting | |
run: pipenv run black --check . | |
build_docker: | |
runs-on: ubuntu-latest | |
needs: lint_and_format | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build and tag Docker image | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: true | |
tags: log680equipe6ete24/oxygencs-grp1-eq6:latest,log680equipe6ete24/oxygencs-grp1-eq6:${{ github.sha }} | |
deploy_docker: | |
runs-on: ubuntu-latest | |
needs: build_docker | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Push Docker image | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: true | |
tags: log680equipe6ete24/oxygencs-grp1-eq6:latest,log680equipe6ete24/oxygencs-grp1-eq6:${{ github.sha }} |