mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-26 02:54:20 +00:00
Merge pull request #447 from ae-utbm/actions
Implemented diff file for CI
This commit is contained in:
commit
69e0550d4f
7
.github/workflows/deploy.yml
vendored
7
.github/workflows/deploy.yml
vendored
@ -4,11 +4,16 @@ concurrency: production
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [master]
|
branches: [master]
|
||||||
|
workflow_run:
|
||||||
|
workflows: [Sith3 CI]
|
||||||
|
types: [completed]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
# Runs only if Unit tests are successful
|
||||||
deployment:
|
deployment:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{github.event.workflow_run.conclusion == 'success'}}
|
||||||
environment: production
|
environment: production
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
|
|
||||||
@ -29,6 +34,8 @@ jobs:
|
|||||||
username : ${{secrets.USER}}
|
username : ${{secrets.USER}}
|
||||||
key: ${{secrets.KEY}}
|
key: ${{secrets.KEY}}
|
||||||
|
|
||||||
|
script_stop: true
|
||||||
|
|
||||||
# See https://github.com/ae-utbm/sith3/wiki/GitHub-Actions#deployment-action
|
# See https://github.com/ae-utbm/sith3/wiki/GitHub-Actions#deployment-action
|
||||||
script: |
|
script: |
|
||||||
export PATH="$HOME/.poetry/bin:$PATH"
|
export PATH="$HOME/.poetry/bin:$PATH"
|
||||||
|
17
.github/workflows/unittests.yml
vendored
17
.github/workflows/unittests.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: Unit Testing
|
name: Sith3 CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
@ -12,36 +12,51 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
# Skip unit testing if no diff on .py files
|
||||||
|
- name: Check file diff
|
||||||
|
uses: technote-space/get-diff-action@v6
|
||||||
|
id: git-diff
|
||||||
|
with:
|
||||||
|
PATTERNS: +**/*.+(py)
|
||||||
|
|
||||||
- name: Set up python
|
- name: Set up python
|
||||||
|
if: steps.git-diff.outputs.diff
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.8'
|
python-version: '3.8'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
if: steps.git-diff.outputs.diff
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install gettext libxapian-dev libgraphviz-dev
|
sudo apt-get install gettext libxapian-dev libgraphviz-dev
|
||||||
|
|
||||||
- name: Install poetry
|
- name: Install poetry
|
||||||
|
if: steps.git-diff.outputs.diff
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
python -m pip install poetry
|
python -m pip install poetry
|
||||||
|
|
||||||
- name: Checking pyproject.toml syntax
|
- name: Checking pyproject.toml syntax
|
||||||
|
if: steps.git-diff.outputs.diff
|
||||||
run: poetry check
|
run: poetry check
|
||||||
|
|
||||||
- name: Install project
|
- name: Install project
|
||||||
|
if: steps.git-diff.outputs.diff
|
||||||
run: poetry install -E testing
|
run: poetry install -E testing
|
||||||
|
|
||||||
- name: Setup xapian index
|
- name: Setup xapian index
|
||||||
|
if: steps.git-diff.outputs.diff
|
||||||
run: |
|
run: |
|
||||||
mkdir -p /dev/shm/search_indexes
|
mkdir -p /dev/shm/search_indexes
|
||||||
ln -s /dev/shm/search_indexes sith/search_indexes
|
ln -s /dev/shm/search_indexes sith/search_indexes
|
||||||
|
|
||||||
- name: Setup project
|
- name: Setup project
|
||||||
|
if: steps.git-diff.outputs.diff
|
||||||
run: poetry run ./manage.py compilemessages
|
run: poetry run ./manage.py compilemessages
|
||||||
|
|
||||||
- name: Launch tests and generate coverage report
|
- name: Launch tests and generate coverage report
|
||||||
|
if: steps.git-diff.outputs.diff
|
||||||
run: |
|
run: |
|
||||||
poetry run coverage run ./manage.py test
|
poetry run coverage run ./manage.py test
|
||||||
poetry run coverage report
|
poetry run coverage report
|
||||||
|
Loading…
Reference in New Issue
Block a user