mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-09 09:58:20 -05:00
Adapt github action to build PR version
This commit is contained in:
parent
eca1289ce2
commit
8d62493774
23
.github/workflows/ansible.yml
vendored
23
.github/workflows/ansible.yml
vendored
@ -5,7 +5,7 @@ on: [push, pull_request]
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
# https://molecule.readthedocs.io/en/latest/ci.html#github-actions
|
# https://molecule.readthedocs.io/en/latest/ci.html#github-actions
|
||||||
test:
|
test-fresh:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#github-context
|
# https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#github-context
|
||||||
if: github.event_name == 'pull_request' || (github.event_name == 'push' && contains(github.ref, 'refs/heads/'))
|
if: github.event_name == 'pull_request' || (github.event_name == 'push' && contains(github.ref, 'refs/heads/'))
|
||||||
@ -31,6 +31,27 @@ jobs:
|
|||||||
cd ansible
|
cd ansible
|
||||||
molecule test -s fresh
|
molecule test -s fresh
|
||||||
working-directory: "${{ github.repository }}"
|
working-directory: "${{ github.repository }}"
|
||||||
|
test-update:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
# https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#github-context
|
||||||
|
if: github.event_name == 'pull_request' || (github.event_name == 'push' && contains(github.ref, 'refs/heads/'))
|
||||||
|
steps:
|
||||||
|
- name: Check out the codebase
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
path: "${{ github.repository }}"
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
- name: Set up Docker
|
||||||
|
uses: docker-practice/actions-setup-docker@master
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python3 -m pip install --upgrade pip
|
||||||
|
python3 -m pip install molecule[ansible,docker]
|
||||||
|
ansible --version
|
||||||
|
docker --version
|
||||||
|
molecule --version
|
||||||
|
python --version
|
||||||
- name: Test release update with molecule
|
- name: Test release update with molecule
|
||||||
run: |
|
run: |
|
||||||
cd ansible
|
cd ansible
|
||||||
|
@ -2,6 +2,12 @@
|
|||||||
- name: fresh installation
|
- name: fresh installation
|
||||||
hosts: all
|
hosts: all
|
||||||
tasks:
|
tasks:
|
||||||
|
- name: set github ref as version when available
|
||||||
|
set_fact:
|
||||||
|
paperlessng_version: "{{ lookup('env', 'GITHUB_REF') | default('latest', True) }}"
|
||||||
|
- name: debug
|
||||||
|
debug:
|
||||||
|
var: paperlessng_version
|
||||||
- name: install paperless-ng with default parameters
|
- name: install paperless-ng with default parameters
|
||||||
include_role:
|
include_role:
|
||||||
name: ansible
|
name: ansible
|
||||||
|
@ -2,10 +2,9 @@
|
|||||||
- name: update previous release to newest release
|
- name: update previous release to newest release
|
||||||
hosts: all
|
hosts: all
|
||||||
tasks:
|
tasks:
|
||||||
- name: set current version as installation target
|
- name: set github ref as version when available
|
||||||
set_fact:
|
set_fact:
|
||||||
paperlessng_version: 0.9.14
|
paperlessng_version: "{{ lookup('env', 'GITHUB_REF') | default('latest', True) }}"
|
||||||
|
|
||||||
- name: update to newest paperless-ng release
|
- name: update to newest paperless-ng release
|
||||||
include_role:
|
include_role:
|
||||||
name: ansible
|
name: ansible
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
tasks:
|
tasks:
|
||||||
- name: set previous version as installation target
|
- name: set previous version as installation target
|
||||||
set_fact:
|
set_fact:
|
||||||
paperlessng_version: 0.9.13
|
paperlessng_version: 1.0.0
|
||||||
|
|
||||||
- name: install previous paperless-ng release
|
- name: install previous paperless-ng release
|
||||||
include_role:
|
include_role:
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
dest: "{{ gitdir.path }}"
|
dest: "{{ gitdir.path }}"
|
||||||
version: "{{ paperlessng_version }}"
|
version: "{{ paperlessng_version }}"
|
||||||
refspec: "+refs/pull/*:refs/pull/*"
|
refspec: "+refs/pull/*:refs/pull/*"
|
||||||
when: '"No such file or directory" in paperlessng_current_version.stderr or paperlessng_current_version.stdout != paperlessng_version | string'
|
|
||||||
|
|
||||||
- name: compile frontend
|
- name: compile frontend
|
||||||
command:
|
command:
|
||||||
@ -31,6 +30,7 @@
|
|||||||
- npm install
|
- npm install
|
||||||
- ./node_modules/.bin/ng build --prod
|
- ./node_modules/.bin/ng build --prod
|
||||||
|
|
||||||
|
# TODO run dev in separate virtualenv
|
||||||
- name: install pipenv
|
- name: install pipenv
|
||||||
pip:
|
pip:
|
||||||
name:
|
name:
|
||||||
@ -44,7 +44,6 @@
|
|||||||
regexp: '^python_version = ".+"$'
|
regexp: '^python_version = ".+"$'
|
||||||
line: python_version = "3"
|
line: python_version = "3"
|
||||||
|
|
||||||
# TODO run dev in separate virtualenv
|
|
||||||
- name: install Pipfile dependencies
|
- name: install Pipfile dependencies
|
||||||
command:
|
command:
|
||||||
cmd: pipenv install --dev
|
cmd: pipenv install --dev
|
||||||
@ -125,7 +124,6 @@
|
|||||||
src: "{{ gitdir.path }}/paperless-ng-{{ paperlessng_version }}.tar.xz"
|
src: "{{ gitdir.path }}/paperless-ng-{{ paperlessng_version }}.tar.xz"
|
||||||
remote_src: yes
|
remote_src: yes
|
||||||
dest: "{{ tempdir.path }}"
|
dest: "{{ tempdir.path }}"
|
||||||
when: '"No such file or directory" in paperlessng_current_version.stderr or paperlessng_current_version.stdout != paperlessng_version | string'
|
|
||||||
|
|
||||||
- name: remove temporary git directory
|
- name: remove temporary git directory
|
||||||
file:
|
file:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user