Skip to content

Commit

Permalink
#115 chore: started migration to dotnet
Browse files Browse the repository at this point in the history
  • Loading branch information
joseantmazonsb committed Feb 22, 2022
1 parent ea78598 commit cbaf445
Show file tree
Hide file tree
Showing 2,489 changed files with 106,134 additions and 19,795 deletions.
39 changes: 16 additions & 23 deletions .github/workflows/latest-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,27 @@ env:
jobs:
deploy:
if: github.event.pull_request.merged
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
dotnet-version: [6]
os: [ ubuntu-20.04 ]
steps:
- uses: actions/checkout@v2
- name: Check out repository
uses: actions/checkout@v2

- name: Set up Python 3.9
uses: actions/setup-python@v2
- name: Set up Dotnet ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet
with:
python-version: 3.9
dotnet-version: ${{ matrix.dotnet-version }}

- name: Upgrade pip
- name: Build and publish
run: |
pip install --upgrade pip
- name: Set up virtual environment using poetry
run: |
wget https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py
python3 install-poetry.py
poetry config virtualenvs.create false
poetry install --no-interaction
- name: Get version
id: get_version
run: |
echo "::set-output name=version::$(poetry version -s)"
- name: Build artifacts
run: |
./build.sh
dotnet publish -c Release -o dist/cli/ ./Linguard/Cli
dotnet publish -c Release -o dist/web/ ./Linguard/Web
cp scripts/* dist/
cp -r systemd/ dist/
tar -zcf linguard-docker.tar.gz ./dist
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
Expand Down
55 changes: 9 additions & 46 deletions .github/workflows/latest-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,62 +12,25 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
dotnet-version: [6]
os: [ ubuntu-20.04 ]
steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Set permissions
run: |
chmod +x linguard/core/tools/*
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: Set up Dotnet ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet
with:
python-version: ${{ matrix.python-version }}

- name: Upgrade pip
run: |
pip install --upgrade pip
- name: Set up virtual environment using poetry
run: |
wget https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py
python3 install-poetry.py
poetry config virtualenvs.create false
poetry install --no-interaction
- name: Install linux dependencies
run: |
sudo apt-get -qq install wireguard iptables
- name: Run tests
run: |
poetry run coverage run -m pytest && poetry run coverage xml --fail-under=80
dotnet-version: ${{ matrix.dotnet-version }}

- name: Check docs are compiled successfully
run: |
cd docs && make html && cd ..
- name: Test
run: dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura Linguard
#run: dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:Threshold=80 Linguard

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v2.1.0
if: always()
with:
files: coverage.xml

- name: Build release
run: |
./build.sh
- name: Install release
run: |
cd dist
tar -xf *.tar.gz
sudo ./install.sh
- name: Briefly test uwgsi (can't use service here)
- name: Check docs are compiled successfully
run: |
sudo -u linguard /usr/bin/uwsgi --yaml /var/www/linguard/data/uwsgi.yaml &
sleep 2s
sudo pkill -f uwsgi
cd docs && make html && cd ..
44 changes: 20 additions & 24 deletions .github/workflows/stable-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,30 @@ env:
jobs:
deploy:
if: github.event.pull_request.merged
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
dotnet-version: [6]
os: [ ubuntu-20.04 ]
steps:
- uses: actions/checkout@v2
- name: Check out repository
uses: actions/checkout@v2

- name: Set up Python 3.9
uses: actions/setup-python@v2
- name: Set up Dotnet ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet
with:
python-version: 3.9
dotnet-version: ${{ matrix.dotnet-version }}

- name: Upgrade pip
- name: Build and publish
run: |
pip install --upgrade pip
- name: Set up virtual environment using poetry
run: |
wget https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py
python3 install-poetry.py
poetry config virtualenvs.create false
poetry install --no-interaction
- name: Get version
id: get_version
run: |
echo "::set-output name=version::$(poetry version -s)"
- name: Build artifacts
run: |
./build.sh
dotnet publish -c Release -o ./dist/docker/cli/ ./Linguard/Cli
dotnet publish -c Release -o ./dist/docker/web/ ./Linguard/Web
dotnet publish -c Release -o ./dist/linux/linguard-web/ --sc --os linux .\Linguard\Web
dotnet publish -c Release -o ./dist/linux/linguard-cli/ --sc --os linux .\Linguard\Cli
tar -zcf linguard-docker.tar.gz ./dist/docker/
tar -zcf linguard-linux.tar.gz ./dist/linux/
cp scripts/* dist/
cp -r systemd/ dist/
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
Expand Down Expand Up @@ -73,7 +69,7 @@ jobs:
name: ${{ steps.get_version.outputs.version }}
tag: "v${{ steps.get_version.outputs.version }}"
commit: "main"
artifacts: "dist/*.tar.gz"
artifacts: "dist/linguard-linux.tar.gz"
bodyFile: "release-notes.md"
discussionCategory: "Announcements"
token: ${{ secrets.GITHUB_TOKEN }}
54 changes: 8 additions & 46 deletions .github/workflows/stable-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,62 +12,24 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
dotnet-version: [6]
os: [ ubuntu-20.04 ]
steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Set permissions
run: |
chmod +x linguard/core/tools/*
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: Set up Dotnet ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet
with:
python-version: ${{ matrix.python-version }}

- name: Upgrade pip
run: |
pip install --upgrade pip
- name: Set up virtual environment using poetry
run: |
wget https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py
python3 install-poetry.py
poetry config virtualenvs.create false
poetry install --no-interaction
- name: Install linux dependencies
run: |
sudo apt-get -qq install wireguard iptables
- name: Run tests
run: |
poetry run coverage run -m pytest && poetry run coverage xml --fail-under=80
dotnet-version: ${{ matrix.dotnet-version }}

- name: Check docs are compiled successfully
run: |
cd docs && make html && cd ..
- name: Test
run: dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:Threshold=80 Linguard

- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v2.1.0
if: always()
with:
files: coverage.xml

- name: Build release
run: |
./build.sh
- name: Install release
run: |
cd dist
tar -xf *.tar.gz
sudo ./install.sh
- name: Briefly test uwgsi (can't use service here)
- name: Check docs are compiled successfully
run: |
sudo -u linguard /usr/bin/uwsgi --yaml /var/www/linguard/data/uwsgi.yaml &
sleep 2s
sudo pkill -f uwsgi
cd docs && make html && cd ..
Loading

0 comments on commit cbaf445

Please sign in to comment.