-
Notifications
You must be signed in to change notification settings - Fork 5
feat(CI): Move CI to Github Actions #71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
8f3d049
ci(flake8): run flake8 in gh CI
samoehlert a281350
ci(gh-actions): add sast, code quality, and dependency scanning in gh…
samoehlert f6b73f7
ci(sast): point to an actual sast tool
samoehlert 736ba6b
ci(pytest): add pytest github action
samoehlert c2e10a5
ci(sast): test this on pushes in this branch
samoehlert ecaee82
ci(actions): turn off duplicate SAST and turn on pytest in this branch
samoehlert 9171cb0
ci(postgres): make postgres start
samoehlert ab44630
ci(updates): use latest versions of actions
samoehlert 649e016
ci(syntax): make all workflows have similar syntax
samoehlert c452612
ci(github-actions): no need for our gitlab CI file anymore
samoehlert 685ca3b
docs(actions): only run docs action on main
samoehlert 4bcf56b
ci(run-always): set action to run on every branch
samoehlert ce9fd23
ci(run-always): run pytest and flake8 on all pushes
samoehlert 5db525f
ci(coverage): automatically add coverage report to our pull requests
samoehlert 81152c3
ci(coverage): update coverage configs to focus the MR output
samoehlert 413e2dc
fix(coverage): only displaying changed files breaks this action
samoehlert File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| name: Run flake8 | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - '**' | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - develop | ||
|
|
||
| # Allows you to run this workflow manually from the Actions tab | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| flake8: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Cache Docker images. | ||
| uses: ScribeMD/docker-cache@0.3.7 | ||
| with: | ||
| key: docker-${{ runner.os }}-${{ hashFiles('docker-compose.yaml') }} | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| pip install flake8 | ||
|
|
||
| - name: Run flake8 | ||
| run: | | ||
| flake8 |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,79 @@ | ||
| name: Run pytest | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - '**' | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - develop | ||
|
|
||
| # Allows you to run this workflow manually from the Actions tab | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| pytest: | ||
| name: Run Pytest | ||
| runs-on: ubuntu-latest | ||
|
|
||
| services: | ||
| postgres: | ||
| image: postgres:latest | ||
| env: | ||
| POSTGRES_USER: scram | ||
| POSTGRES_PASSWORD: '' | ||
| POSTGRES_DB: test_scram | ||
| POSTGRES_HOST_AUTH_METHOD: trust | ||
| ports: | ||
| - 5432:5432 | ||
| options: >- | ||
| --health-cmd "pg_isready -U scram" | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
|
|
||
| steps: | ||
| - name: Check out the code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Docker | ||
| uses: docker/setup-buildx-action@v3 | ||
| - name: Install Docker Compose | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y docker-compose make | ||
|
|
||
| - name: Build Docker images | ||
| run: make build | ||
|
|
||
| - name: Migrate Database | ||
| run: make migrate | ||
|
|
||
| - name: Run Application | ||
| run: make run | ||
|
|
||
| - name: Run Pytest with Coverage | ||
| env: | ||
| POSTGRES_USER: scram | ||
| POSTGRES_DB: test_scram | ||
| run: make coverage.xml | ||
|
|
||
| - name: Upload Coverage Report | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: coverage-report | ||
| path: coverage.xml | ||
samoehlert marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Display Coverage Metrics | ||
| uses: 5monkeys/cobertura-action@v14 | ||
| with: | ||
| minimum_coverage: '50' | ||
|
|
||
| - name: Stop Services | ||
| if: always() | ||
| run: make stop | ||
|
|
||
| - name: Clean Up | ||
| if: always() | ||
| run: make clean | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.