Skip to content

Commit

Permalink
Add github action CI workflow for the backend (#2)
Browse files Browse the repository at this point in the history
* move .github created by template

* tweak workflow

* move default

* change working dir again

* try hardcoding

* add workspace at job level

* add workspace to install

* fix syntax

* try something completely different

* remove flake8 lint

* check env params

* add precommit

* code ruff'd

* code black'd

* get precommit working

* rename for backend
  • Loading branch information
jacobfilik authored Mar 4, 2024
1 parent 53411fd commit 981c30e
Show file tree
Hide file tree
Showing 12 changed files with 246 additions and 498 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ci-backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./xas-standards-api
strategy:
matrix:
python-version: ["3.10", "3.11"]

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install .[dev]
- name: Lint
run: tox -e pre-commit
- name: Test with pytest
run: |
python3 -m pytest
8 changes: 3 additions & 5 deletions xas-standards-api/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"ms-python.python",
"tamasfe.even-better-toml",
"redhat.vscode-yaml",
"ryanluker.vscode-coverage-gutters"
"ryanluker.vscode-coverage-gutters",
"charliermarsh.ruff"
]
}
},
Expand All @@ -39,9 +40,6 @@
// map in home directory - not strictly necessary but useful
"source=${localEnv:HOME},target=${localEnv:HOME},type=bind,consistency=cached"
],
// make the workspace folder the same inside and outside of the container
"workspaceMount": "source=${localWorkspaceFolder},target=${localWorkspaceFolder},type=bind",
"workspaceFolder": "${localWorkspaceFolder}",
// After the container is created, install the python project in editable form
"postCreateCommand": "pip install -e '.[dev]'"
}
}
60 changes: 0 additions & 60 deletions xas-standards-api/.github/actions/install_requirements/action.yml

This file was deleted.

20 changes: 0 additions & 20 deletions xas-standards-api/.github/dependabot.yml

This file was deleted.

251 changes: 0 additions & 251 deletions xas-standards-api/.github/workflows/code.yml

This file was deleted.

Loading

0 comments on commit 981c30e

Please sign in to comment.