Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run unit tests in CI #22

Merged
merged 1 commit into from
Feb 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Deploy localdev
on:
pull_request:
workflow_dispatch:
jobs:
deploy-localdev:
uses: LibriVox/librivox-ansible/.github/workflows/localdev.yml@master
with:
catalog_git_branch: master
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
name: Deploy LibriVox local development environment
name: Deploy localdev (reusable)
on:
pull_request:
workflow_dispatch:
workflow_call:
inputs:
catalog_git_branch:
required: true
type: string
jobs:
deploy-localdev:
deploy-localdev-reusable:
runs-on: 'ubuntu-22.04'
timeout-minutes: 15
steps:
Expand All @@ -25,7 +28,7 @@ jobs:
playbook: localdev.yaml
inventory: |
[localdev]
${{ steps.lxc.outputs.ip }} ansible_user=root ci_env=development ci_log_threshold=4
${{ steps.lxc.outputs.ip }} ansible_user=root ci_env=development ci_log_threshold=4 catalog_git_branch=${{ catalog_git_branch }}
options:
-l localdev

Expand All @@ -37,3 +40,7 @@ jobs:
web-url: "https://librivox.org/dust-of-the-desert-by-robert-welles-ritchie/"
scan-for-text: "BENICIA"
insecure: true

- name: Run unit tests
run: |
ssh librivox.org 'cd /librivox/www/librivox.org/catalog && XDEBUG_MODE=coverage vendor/bin/phpunit -c application/tests'
7 changes: 6 additions & 1 deletion roles/blog+catalog/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,14 @@
git:
repo: https://github.com/LibriVox/librivox-catalog.git
dest: /librivox/www/librivox.org/catalog
version: master
version: {{ catalog_git_branch }}
force: yes

- name: Catalog unit tests dependecies
command: php composer.phar require --dev kenjis/ci-phpunit-test:^3.0
args:
chdir: /librivox/www/librivox.org/catalog

- name: CodeIgniter sessions directory
file:
path: /tmp/php-sessions
Expand Down
6 changes: 3 additions & 3 deletions roles/common/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
name: ['git', 'apache2', 'mariadb-server', 'php8.1-fpm', 'php8.1-mysql',
'php8.1-curl', 'php8.1-memcache', 'php8.1-memcached', 'php8.1-intl',
'php8.1-mbstring', 'php8.1-xml', 'php8.1-zip', 'php8.1-apcu',
'php8.1-gd', 'php8.1-imagick', 'python3-certbot-apache',
'python3-mysqldb', 'sphinxsearch', 'mp3gain', 'unzip', 'memcached',
'imagemagick']
'php8.1-gd', 'php8.1-imagick', 'php8.1-xdebug',
'python3-certbot-apache', 'python3-mysqldb', 'sphinxsearch',
'mp3gain', 'unzip', 'memcached', 'imagemagick']
state: latest
update_cache: yes
become: true
Expand Down
1 change: 1 addition & 0 deletions vars/localdev.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
catalog_git_branch: master
iarchive_uploader_access_key: invalid
iarchive_uploader_secret_key: invalid
codeigniter_encryption_key: some_random_string
Expand Down
233 changes: 117 additions & 116 deletions vars/production.enc

Large diffs are not rendered by default.

225 changes: 113 additions & 112 deletions vars/staging.enc

Large diffs are not rendered by default.