Skip to content

Commit

Permalink
Add CI (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
hippalectryon-0 authored Oct 20, 2023
1 parent 1128f72 commit c52caa3
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 5 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: CI/CD

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: setup
run: |
cp log-grid/.pre-commit-config.yaml .
cp log-grid/pyproject.toml .
- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]

build:
runs-on: ubuntu-latest
container:
image: tempuser8755/python3.11-clang15-omp:latest
strategy:
matrix:
python-version: [ '3.11' ]

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'

- name: Install Poetry & venv
run: |
python3.11 -m pip install poetry
python3.11 -m virtualenv .venv
. .venv/bin/activate
- name: Install dependencies
run: |
. .venv/bin/activate
cd log-grid
poetry install
pip uninstall -y pyloggrid # remove from site-packages, use local source instead (instead we get wrong coverage)
- name: Compile
run: |
. .venv/bin/activate
cd log-grid
cd pyloggrid/LogGrid
make
- name: Run Flake8
run: |
. .venv/bin/activate
cd log-grid
flake8 . --count --ignore=E203,E266,E402,E501,E731,E741,W503 --show-source --statistics --exclude=.venv,Archive,Examples/Draft
- name: Run Tests
run: |
. .venv/bin/activate
cd log-grid
python -m pytest -v --junitxml=report.xml --cov=. --cov-report xml:coverage.xml --cov-report term
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ log-grid/*
!log-grid/Simulations/
!log-grid/.gitlab
!log-grid/readme_pypi.md
!log-grid/build.py
!log-grid/build.py
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ This repository is used to open-source the code and documentation, and allow iss

**The code of interest if located in log-grid/. The files in the root directory are only used to link the Gitlab and Github, and build documentation.**

*Since this is not the main repository, and requires syncing by hand, it may not always be up to date with the latest version. If you think this repository is missing a version, don't hesitate to open an issue.*
*Since this is not the main repository, and requires syncing by hand, it may not always be up to date with the latest version. If you think this repository is missing a version, don't hesitate to open an issue.*
2 changes: 1 addition & 1 deletion readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ build:
- cd log-grid && poetry config virtualenvs.create false
- cd log-grid && poetry install --with=docs
sphinx:
configuration: log-grid/docs/conf.py
configuration: log-grid/docs/conf.py
2 changes: 1 addition & 1 deletion update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ Remove-Item -Path .\log-grid -Recurse -ErrorAction SilentlyContinue
git clone https://drf-gitlab.cea.fr/amaury.barral/log-grid.git -b 2.2.0 # Change the tag accordingly
cd log-grid
Remove-Item -Recurse -Force .git
Set-Location ../
Set-Location ../
2 changes: 1 addition & 1 deletion updating.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

- `rm -rf log-grid`
- `git clone https://drf-gitlab.cea.fr/amaury.barral/log-grid.git`
- `rm -rf log-grid/.git`
- `rm -rf log-grid/.git`

0 comments on commit c52caa3

Please sign in to comment.