Skip to content

Build

Build #5714

Workflow file for this run

# Runs tests and verifies that the package can be built.
name: Build
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [main]
paths-ignore:
- "**.md"
pull_request:
branches: [main]
paths-ignore:
- "**.md"
schedule:
- cron: "*/30 * * * *" # run every @hourly
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
runs-on: ${{matrix.operating-system}}
strategy:
fail-fast: false
matrix:
# operating-system: [ubuntu-latest]
operating-system: [ubuntu-22.04, ubuntu-20.04]
# php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.3']
php-versions: ['8.1', '8.2', '8.3']
name: build and test using PHP ${{ matrix.php-versions }} with ${{ matrix.operating-system }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up PHP with PECL extension
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: intl #optional
ini-values: "post_max_size=256M" #optional
- name: Install dependencies
run: composer install
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
check-latest: true
- name: Install NPM dependencies
run: npm install
- name: Compile assets for production
run: npm run build
- name: Push to repository
run: |
if [ "$(git status --porcelain=v1 2>/dev/null | wc -l)" != "0" ]; then
# git add src/debian/control
git commit -m "Update packages from ${{ matrix.operating-system }} at $(date +'%d-%m-%y')" &&
git push ||
git stash &&
git pull --rebase &&
git stash apply &&
git push || true
fi