Skip to content

Fix JS style

Fix JS style #3229

Workflow file for this run

name: CI
on:
push:
tags:
- '**'
branches:
- '**'
pull_request:
workflow_dispatch:
schedule:
# run the CI workflow at 6:00am UTC every Monday
- cron: '0 6 * * MON'
jobs:
build-test:
runs-on: ubuntu-latest
permissions:
packages: write
timeout-minutes: 60
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
php_version: [ "8.1", "8.2", "8.3", "8.4" ]
experimental: [ false ]
steps:
- name: Check out repository code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Start up containers
run: cd tests; ./init_containers.sh
- name: Cache Composer dependencies
uses: actions/cache@v3
with:
path: |
/tmp/composer-cache
vendor
components
key: ${{ runner.os }}-php${{ matrix.php_version}}-skosmos3-${{ hashFiles('**/composer.json') }}
restore-keys: |
${{ runner.os }}-php${{ matrix.php_version}}-skosmos3-
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php_version }}
extensions: intl, xsl, pcov
coverage: pcov
- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 24.x
- name: Install JavaScript dependencies
run: npm install
- name: Check PHP code style
run: ./vendor/bin/php-cs-fixer fix src --diff --dry-run
- name: Check JavaScript code style
run: cd resource/js; npx standard *.js
- name: Run PHPUnit tests
run: ./vendor/bin/phpunit --configuration phpunit.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
cypress-test:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Start up containers
run: cd tests; ./init_containers.sh
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 24.x
- name: Install JavaScript dependencies
run: npm install
- name: Run Cypress tests
run: npx cypress run
publish-docker-latest:
name: publish latest Docker image
needs: [ build-test, cypress-test ]
runs-on: ubuntu-24.04
timeout-minutes: 15
if: github.event_name == 'push' && github.ref_name == 'main'
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Login to Quay.io
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
with:
registry: quay.io
username: ${{ secrets.YHTEENTOIMIVUUSPALVELUT_QUAY_IO_USERNAME }}
password: ${{ secrets.YHTEENTOIMIVUUSPALVELUT_QUAY_IO_PASSWORD }}
- name: Docker meta
id: meta
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
with:
images: quay.io/natlibfi/skosmos
tags: |
type=raw,value=latest
- name: Build and push to Quay.io
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: .
file: dockerfiles/Dockerfile.ubuntu
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
publish-release:
name: publish release
needs: [ build-test, cypress-test ]
runs-on: ubuntu-24.04
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && !contains(github.ref_name, 'dev')
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Login to Quay.io
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
with:
registry: quay.io
username: ${{ secrets.YHTEENTOIMIVUUSPALVELUT_QUAY_IO_USERNAME }}
password: ${{ secrets.YHTEENTOIMIVUUSPALVELUT_QUAY_IO_PASSWORD }}
- name: Docker meta
id: meta
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
with:
images: quay.io/natlibfi/skosmos
tags: |
type=ref,event=tag
type=semver,pattern={{version}},suffix=-{{date 'YYYYMMDD'}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Build and push to Quay.io
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
context: .
file: dockerfiles/Dockerfile.ubuntu
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}