mirror of
https://github.com/ae-utbm/sith.git
synced 2025-04-18 03:50:17 +00:00
Merge pull request #441 from ae-utbm/actions
First try for CI/CD using actions
This commit is contained in:
commit
0470aa185e
21
.github/workflows/deploy.yml
vendored
Normal file
21
.github/workflows/deploy.yml
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
name: Deploy to production
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_run:
|
||||||
|
workflows: [Unit Testing]
|
||||||
|
types: [completed]
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
on-success:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||||
|
steps:
|
||||||
|
- run: echo 'The triggering workflow passed'
|
||||||
|
|
||||||
|
on-failure:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
|
||||||
|
steps:
|
||||||
|
- run: echo 'The triggering workflow failed'
|
63
.github/workflows/unittests.bak
vendored
Normal file
63
.github/workflows/unittests.bak
vendored
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
name: Unit Testing
|
||||||
|
|
||||||
|
on: [push]
|
||||||
|
jobs:
|
||||||
|
unittests:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: '3.8'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install gettext libxapian-dev libgraphviz-dev
|
||||||
|
|
||||||
|
- name: Install poetry
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
python -m pip install poetry
|
||||||
|
|
||||||
|
- name: Checking pyproject.toml syntax
|
||||||
|
run: poetry check
|
||||||
|
|
||||||
|
- name: Install project
|
||||||
|
run: poetry install -E testing
|
||||||
|
|
||||||
|
- name: Setup xapian index
|
||||||
|
run: |
|
||||||
|
mkdir -p /dev/shm/search_indexes
|
||||||
|
ln -s /dev/shm/search_indexes sith/search_indexes
|
||||||
|
|
||||||
|
- name: Setup project
|
||||||
|
run: poetry run ./manage.py compilemessages
|
||||||
|
|
||||||
|
- name: Launch tests and generate coverage report
|
||||||
|
run: |
|
||||||
|
poetry run coverage run ./manage.py test
|
||||||
|
poetry run coverage report
|
||||||
|
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Set up python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: '3.8'
|
||||||
|
|
||||||
|
- name: Install black
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
python -m pip install black==22.6.0
|
||||||
|
|
||||||
|
- name: Check linting
|
||||||
|
run: black --check .
|
||||||
|
|
||||||
|
|
17
.github/workflows/unittests.yml
vendored
Normal file
17
.github/workflows/unittests.yml
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
name: Unit Testing
|
||||||
|
|
||||||
|
on: [push]
|
||||||
|
jobs:
|
||||||
|
unittests:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- run: echo 'Dry test'
|
||||||
|
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- run: echo 'Dry lint'
|
||||||
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user