mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-12-01 04:40:45 +09:00
* Rework reusable workflows to use composite actions (#1918) * Update FOSSBilling/.workflows digest to 5c7b960 * Update dependency apexcharts to v3.44.2 * Update CKEditor to v39.3.0 (minor) (#1931) Update CKEditor to v39.3.0 Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update dependency core-js to v3.34.0 (#1932) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update dependency cypress to v13.6.1 * Update dependency flag-icons to v7.0.3 * Update dependency phpunit/phpunit to v10.5.2 * Bump lcharette/webpack-encore-twig to v1.2 (#1933) Bump lcharette/webpack-encore-twig Bump lcharette/webpack-encore-twig to ^1.2 and remove symfony/webpack-encore-bundle override as now fixed upstream. * Move Dockerfile from Docker repo * Add Docker preview build and push to CI * Add workflow to build and tag Docker builds on release * Update workflow to build and tag Docker builds on release --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
131 lines
4.2 KiB
YAML
131 lines
4.2 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
branches: main
|
|
|
|
jobs:
|
|
spellcheck:
|
|
name: 'Spellcheck'
|
|
permissions:
|
|
contents: read
|
|
runs-on: ubuntu-latest
|
|
if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.base.repo.id != github.event.pull_request.head.repo.id) || github.event_name == 'push' }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: 'Perform Spellcheck'
|
|
uses: streetsidesoftware/cspell-action@v5
|
|
with:
|
|
incremental_files_only: true
|
|
|
|
php-build-test:
|
|
name: 'PHP Build and Test'
|
|
permissions:
|
|
contents: read
|
|
needs: [ spellcheck ]
|
|
if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.base.repo.id != github.event.pull_request.head.repo.id) || github.event_name == 'push' }}
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
php: [8.1, 8.2, 8.3]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: 'PHP Build'
|
|
uses: FOSSBilling/.workflows/.github/actions/php-build@fd299987b1bf7ea82885ca0642a25d8546cc3226
|
|
with:
|
|
php-version: ${{ matrix.php }}
|
|
|
|
- name: 'Prepare Test Environment'
|
|
run: |
|
|
cp ./src/config-sample.php ./src/config.php
|
|
mkdir -p ./src/data/{cache,log}
|
|
echo APP_ENV=test >> $GITHUB_ENV
|
|
|
|
- name: 'PHP Tests (PHPStan and PHPUnit)'
|
|
uses: FOSSBilling/.workflows/.github/actions/php-test@fd299987b1bf7ea82885ca0642a25d8546cc3226
|
|
with:
|
|
php-version: ${{ matrix.php }}
|
|
phpstan-enable: 'true'
|
|
phpstan-php-version: 8.3
|
|
phpunit-enable: 'true'
|
|
phpunit-version: 10
|
|
|
|
preview-build:
|
|
name: 'Create Preview Release'
|
|
permissions:
|
|
contents: read
|
|
needs: [ php-build-test ]
|
|
if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.base.repo.id != github.event.pull_request.head.repo.id) || github.event_name == 'push' }}
|
|
uses: ./.github/workflows/release-build.yml
|
|
with:
|
|
artifact-name: 'preview-build'
|
|
preview: true
|
|
|
|
upload-preview:
|
|
name: 'Upload Preview Release'
|
|
permissions:
|
|
contents: read
|
|
needs: [ preview-build ]
|
|
if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.base.repo.id != github.event.pull_request.head.repo.id) || github.event_name == 'push' }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: 'Download Preview Release Archive'
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: preview-build
|
|
path: '/tmp'
|
|
|
|
- name: 'Extract Preview Release Archive'
|
|
run: |
|
|
mkdir ./src
|
|
tar -xvf /tmp/build.tar -C ./src
|
|
|
|
- name: 'Create Downloadable Preview'
|
|
run: zip -r ../FOSSBilling-preview.zip .
|
|
working-directory: ./src/
|
|
|
|
- name: 'Move Downloadable Preview for Upload'
|
|
run: |
|
|
mkdir ./dist
|
|
mv ./FOSSBilling-preview.zip ./dist
|
|
|
|
- name: 'Upload Downloadable Preview to S3'
|
|
if: ${{ github.ref == 'refs/heads/main' }}
|
|
uses: jakejarvis/s3-sync-action@master
|
|
with:
|
|
args: '--acl public-read --follow-symlinks'
|
|
env:
|
|
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
|
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
AWS_S3_ENDPOINT: ${{ secrets.AWS_S3_ENDPOINT }}
|
|
SOURCE_DIR: './dist'
|
|
|
|
- name: 'Upload Downloadable Preview to GitHub'
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
if-no-files-found: 'error'
|
|
name: 'FOSSBilling Preview'
|
|
path: './src/*'
|
|
retention-days: 14
|
|
|
|
deploy-preview-docker:
|
|
name: 'Build and Push Preview to Docker Hub'
|
|
permissions:
|
|
contents: read
|
|
needs: [ preview-build ]
|
|
if: ${{ github.ref == 'refs/heads/main' }}
|
|
uses: FOSSBilling/.workflows/.github/workflows/docker-build-push.yml@fd299987b1bf7ea82885ca0642a25d8546cc3226
|
|
secrets:
|
|
dockerhub-username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
dockerhub-token: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
with:
|
|
download-artifact: 'preview-build'
|
|
platforms: '["linux/amd64", "linux/arm64"]'
|
|
repository-name: 'fossbilling/fossbilling'
|
|
tag-latest: 'false'
|
|
tag-raw: 'preview'
|