mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
101 lines
3.2 KiB
YAML
101 lines
3.2 KiB
YAML
name: Gradido Admin Interface Test CI
|
|
|
|
on: push
|
|
|
|
jobs:
|
|
# only (but most important) job from this workflow required for pull requests
|
|
# check results serve as run conditions for all other jobs here
|
|
files-changed:
|
|
name: Detect File Changes - Admin Interface
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
admin: ${{ steps.changes.outputs.admin }}
|
|
config: ${{ steps.changes.outputs.config }}
|
|
steps:
|
|
- uses: actions/checkout@v3.3.0
|
|
|
|
- name: Check for admin interface file changes
|
|
uses: dorny/paths-filter@v2.11.1
|
|
id: changes
|
|
with:
|
|
token: ${{ github.token }}
|
|
filters: .github/file-filters.yml
|
|
list-files: shell
|
|
|
|
|
|
build_test:
|
|
if: needs.files-changed.outputs.config == 'true' || needs.files-changed.outputs.admin == 'true'
|
|
name: Docker Build Test - Admin Interface
|
|
needs: files-changed
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Admin Interface | Build 'test' image
|
|
run: docker build -f ./admin/Dockerfile --target production -t "gradido/admin:production" --build-arg NODE_ENV="production" --build-arg BUILD_COMMIT=$(git rev-parse HEAD) --build-arg BUILD_COMMIT_SHORT=$(git rev-parse --short HEAD) .
|
|
|
|
unit_test:
|
|
if: needs.files-changed.outputs.config == 'true' || needs.files-changed.outputs.admin == 'true'
|
|
name: Unit Tests - Admin Interface
|
|
needs: files-changed
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
test-success: ${{ steps.test.outputs.success }}
|
|
steps:
|
|
- name: Set Node.js version
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '18.20.7'
|
|
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install turbo
|
|
run: yarn global add turbo@^2
|
|
|
|
- name: Prune admin with turbos help
|
|
run: turbo prune admin
|
|
|
|
- name: install dependencies
|
|
run: cd out && yarn install --frozen-lockfile --production=false
|
|
|
|
- name: Admin Interface | Unit tests
|
|
id: test
|
|
run: |
|
|
cd out && turbo admin#test admin#lint
|
|
echo "success=$([ $? -eq 0 ] && echo true || echo false)" >> $GITHUB_OUTPUT
|
|
|
|
lint:
|
|
if: needs.files-changed.outputs.admin == 'true'
|
|
name: Lint - Admin Interface
|
|
needs: [files-changed, unit_test]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check result from previous step
|
|
run: if [ "${{ needs.unit_test.outputs.test-success }}" != "true" ]; then exit 1; fi
|
|
|
|
stylelint:
|
|
if: needs.files-changed.outputs.admin == 'true'
|
|
name: Stylelint - Admin Interface
|
|
needs: [files-changed, unit_test]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Check result from previous step
|
|
run: if [ "${{ needs.unit_test.outputs.test-success }}" != "true" ]; then exit 1; fi
|
|
|
|
locales:
|
|
if: needs.files-changed.outputs.admin == 'true'
|
|
name: Locales - Admin Interface
|
|
needs: [files-changed, unit_test]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Check result from previous step
|
|
run: if [ "${{ needs.unit_test.outputs.test-success }}" != "true" ]; then exit 1; fi |