#1 Pipeline setup #5
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Default | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '21.x' | |
- name: Dependencies setup | |
run: npm ci | |
- name: Build | |
run: npm run build --if-present | |
- name: Run linters | |
run: npm run lint | |
- name: Run unit tests with coverage | |
run: npm run test:cov | |
- name: Seed database | |
run: npm run seed | |
- name: Run e2e tests | |
run: npm run test:e2e | |
- name: Get Swagger JSON | |
run: | | |
npm run export-swagger | |
- name: Save Swagger JSON as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: swagger.json | |
path: artifacts/swagger.json | |
- name: Generate client | |
run: | | |
docker run --rm -v "$(pwd)/artifacts:/local/artifacts" -w /local/artifacts \ | |
openapitools/openapi-generator-cli generate \ | |
-i /local/artifacts/swagger.json \ | |
-g php \ | |
-o /local/artifacts/ram-fanbase-client-php \ | |
--invoker-package FanbaseApiClient --git-user-id davidlukac \ | |
--git-repo-id ram-fanbase-client-php \ | |
--additional-properties=licenseName="MIT" \ | |
--additional-properties=authorName="David Lukac" \ | |
--additional-properties=homepage="https://github.com/davidlukac" | |
- name: Install Composer | |
run: | | |
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | |
php -r "if (hash_file('sha384', 'composer-setup.php') === 'e21205b207c3ff031906575712edab6f13eb0b361f2085f1f1237b7126d785e826a450292b6cfd1d64d92e6563bbde02') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" | |
php composer-setup.php | |
php -r "unlink('composer-setup.php');" | |
sudo mv composer.phar /usr/local/bin/composer | |
composer --version |