mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-29 12:34:21 +00:00
Actions seem to be operationnal
This commit is contained in:
parent
8646b2c8f7
commit
596126f4f4
20
.github/workflows/deploy.yml
vendored
20
.github/workflows/deploy.yml
vendored
@ -1,14 +1,16 @@
|
|||||||
name: Deploy to production
|
name: Deploy to production
|
||||||
|
concurrency: production
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ actions ]
|
branches: [master]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deployment:
|
deployment:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment: production
|
environment: production
|
||||||
|
timeout-minutes: 30
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: SSH Remote Commands
|
- name: SSH Remote Commands
|
||||||
@ -27,6 +29,18 @@ jobs:
|
|||||||
username : ${{secrets.USER}}
|
username : ${{secrets.USER}}
|
||||||
key: ${{secrets.KEY}}
|
key: ${{secrets.KEY}}
|
||||||
|
|
||||||
|
# See https://github.com/ae-utbm/sith3/wiki/GitHub-Actions#deployment-action
|
||||||
script: |
|
script: |
|
||||||
whoami
|
BASE_DIR="$(dirname "$(realpath "$0")")"
|
||||||
ls -al
|
export PATH="$HOME/.poetry/bin:$PATH"
|
||||||
|
pushd $BASE_DIR
|
||||||
|
|
||||||
|
VERSION_LAST=$(git rev-parse HEAD)
|
||||||
|
git pull
|
||||||
|
poetry update
|
||||||
|
poetry run ./manage.py migrate
|
||||||
|
echo "yes" | poetry run ./manage.py collectstatic
|
||||||
|
poetry run ./manage.py compilestatic
|
||||||
|
poetry run ./manage.py compilemessages
|
||||||
|
|
||||||
|
sudo systemctl restart uwsgi
|
68
.github/workflows/unittests.bak
vendored
68
.github/workflows/unittests.bak
vendored
@ -1,68 +0,0 @@
|
|||||||
name: Unit Testing
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ master ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ master ]
|
|
||||||
|
|
||||||
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 .
|
|
||||||
|
|
||||||
|
|
51
.github/workflows/unittests.yml
vendored
51
.github/workflows/unittests.yml
vendored
@ -9,14 +9,61 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
unittests:
|
unittests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 30
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- run: echo 'Dry test'
|
- 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:
|
lint:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- run: echo 'Dry lint'
|
- 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 .
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user