Browse Source

Change github actions workflow strategy

pull/531/head
Guillaume Vincent 4 years ago
parent
commit
3a12d21949
5 changed files with 55 additions and 30 deletions
  1. +35
    -0
      .github/workflows/deploy-cli.yml
  2. +3
    -18
      .github/workflows/deploy.yml
  3. +6
    -10
      .github/workflows/test.yml
  4. +0
    -2
      cli/deploy
  5. +11
    -0
      cli/test

+ 35
- 0
.github/workflows/deploy-cli.yml View File

@@ -0,0 +1,35 @@
name: deploy-cli

on:
push:
paths:
- 'cli/lesspass/version.py'

jobs:
test-cli:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: '3.6'
- name: test cli
run: |
cd cli
./test
deploy-cli:
runs-on: ubuntu-latest
needs: test-cli
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: '3.6'
- name: deploy cli
run: |
cd cli
./deploy
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}


+ 3
- 18
.github/workflows/deploy.yml View File

@@ -9,7 +9,7 @@ jobs:
deploy-containers: deploy-containers:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: deploy containers - name: deploy containers
run: | run: |
./bin/deploy_containers ./bin/deploy_containers
@@ -20,32 +20,17 @@ jobs:
deploy-node-modules: deploy-node-modules:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: deploy node modules - name: deploy node modules
run: | run: |
./bin/deploy_node_modules ./bin/deploy_node_modules
env: env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }}


deploy-cli:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: deploy cli
run: |
./bin/deploy_cli
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

deploy-web-extensions: deploy-web-extensions:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: deploy web extensions - name: deploy web extensions
run: | run: |
./bin/deploy_web_extensions ./bin/deploy_web_extensions


+ 6
- 10
.github/workflows/test.yml View File

@@ -6,7 +6,7 @@ jobs:
test-packages: test-packages:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: test packages - name: test packages
run: | run: |
yarn install yarn install
@@ -15,7 +15,7 @@ jobs:
test-mobile: test-mobile:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: test mobile - name: test mobile
run: | run: |
cd mobile cd mobile
@@ -27,25 +27,21 @@ jobs:
strategy: strategy:
max-parallel: 3 max-parallel: 3
matrix: matrix:
python-version: [3.5, 3.6, 3.7]
python-version: [3.6, 3.7, 3.8]
steps: steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- uses: actions/setup-python@v1 - uses: actions/setup-python@v1
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
- name: test cli - name: test cli
run: | run: |
cd cli cd cli
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install -r test-requirements.txt
export PYTHONPATH='.'
python -m unittest discover
./test


test-backend: test-backend:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- uses: actions/setup-python@v1 - uses: actions/setup-python@v1
with: with:
python-version: "3.6" python-version: "3.6"


bin/deploy_cli → cli/deploy View File

@@ -16,12 +16,10 @@ set -o pipefail
set -o nounset set -o nounset


function push_cli_on_pypi { function push_cli_on_pypi {
pushd cli
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install setuptools wheel twine pip install setuptools wheel twine
python setup.py sdist bdist_wheel python setup.py sdist bdist_wheel
twine upload dist/* twine upload dist/*
popd
} }


push_cli_on_pypi push_cli_on_pypi

+ 11
- 0
cli/test View File

@@ -0,0 +1,11 @@
#!/usr/bin/env bash

set -o errexit
set -o pipefail
set -o nounset

python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install -r test-requirements.txt
export PYTHONPATH='.'
python -m unittest discover

Loading…
Cancel
Save