Skip to content

Commit

Permalink
Cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
VoronM1522 committed Feb 15, 2025
1 parent def8bd7 commit 97845f9
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 0 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/C++_app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: C++ Application CI

on:
push:

env:
USERNAME: voronm1522
DOCKER_IMAGE: voronm1522/devops
DOCKER_TAG: cpp-app

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- name: Cache python
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ubuntu-python-${{ hashFiles('app_python/requirements.txt') }}
restore-keys: |
ubuntu-python-
- uses: actions/checkout@v3

- name: Set up python
uses: actions/setup-python@v3
with:
python-version: '3.10'

- name: Install dependencies and linter
run: |
python -m pip install --upgrade pip
pip install flake8
pip install -r app_python/requirements.txt
- name: Lint with flake8
run: |
flake8 app_python/app.py
- name: Run tests
run: |
python app_python/unittests.py
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ env.USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ubuntu-docker-${{ hashFiles('app_python/Dockerfile') }}
restore-keys: |
ubuntu-docker-
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: app_python
push: true
tags: ${{ env.DOCKER_IMAGE }}:${{ env.DOCKER_TAG }}

- name: Install snyk
run: npm install -g snyk

- name: Run snyk
run: |
cd app_python
snyk test
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"files.associations": {
"string": "cpp",
"cstdlib": "cpp"
}
}

0 comments on commit 97845f9

Please sign in to comment.