Draft: Extend react app #321
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: CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
jobs: | |
rubocop: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup prerequisites theforeman-rubocop | |
run: | | |
sudo apt-get update && sudo apt-get -y install libyaml-dev | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 2.7 | |
bundler-cache: true | |
- name: Run rubocop | |
run: bundle exec rubocop -P --format github | |
build: | |
runs-on: ubuntu-latest | |
needs: rubocop | |
services: | |
db: | |
image: postgres:13 | |
ports: ['5432:5432'] | |
env: | |
POSTGRES_USER: foreman | |
POSTGRES_PASSWORD: foreman | |
POSTGRES_DB: foreman | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
repository: theforeman/foreman | |
ref: develop | |
path: foreman | |
- uses: actions/checkout@v3 | |
with: | |
repository: theforeman/foreman_fog_proxmox | |
path: foreman_fog_proxmox | |
- uses: actions/checkout@v3 | |
with: | |
repository: fog/fog-proxmox | |
path: fog-proxmox | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '2.7' | |
bundler-cache: true | |
- name: Setup foreman | |
env: | |
PGHOST: 127.0.0.1 | |
PGDB: foreman | |
PGPWD: foreman | |
PGUSER: foreman | |
RAILS_ENV: test | |
DISABLE_SPRING: true | |
working-directory: ./foreman | |
run: | | |
sudo apt-get update && sudo apt-get -y install build-essential libpq-dev libsystemd-dev | |
gem install bundler -v 2.4.22 | |
echo -n -e "gem 'foreman_fog_proxmox', :path => '../foreman_fog_proxmox'\n gem 'fog-proxmox', :path => '../fog-proxmox'\n gem 'simplecov'" > bundler.d/Gemfile.local.rb | |
cp config/settings.yaml.test config/settings.yaml | |
echo -n -e "test:\n adapter: postgresql \n port: 5432 \n database: foreman \n username: foreman \n password: foreman \n encoding: utf8 \n pool: 10" > config/database.yml | |
cp config/ignored_environments.yml.sample config/ignored_environments.yml | |
bundle config set without 'libvirt ovirt mysql2' | |
bundle install --jobs 4 --retry 3 | |
bundle exec bin/rake db:migrate | |
bundle exec bin/rake db:seed | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: '14' | |
- name: Setup node assets | |
working-directory: ./foreman | |
env: | |
PGHOST: 127.0.0.1 | |
PGDB: foreman | |
PGPWD: foreman | |
PGUSER: foreman | |
RAILS_ENV: test | |
DISABLE_SPRING: true | |
run: | | |
npm install | |
bundle exec bin/rake assets:precompile locale:pack webpack:compile | |
- name: Run test suite with coverage report | |
working-directory: ./foreman | |
env: | |
PGHOST: 127.0.0.1 | |
PGDB: foreman | |
PGPWD: foreman | |
PGUSER: foreman | |
RAILS_ENV: test | |
DISABLE_SPRING: true | |
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}} | |
COVERAGE: true | |
run: | | |
bundle exec bin/rake test:foreman_fog_proxmox | |
- name: Upload simplecov results for coverage | |
uses: actions/upload-artifact@v1 | |
with: | |
name: coverage | |
path: foreman_fog_proxmox/coverage/ | |
coverage: | |
needs: [ build ] | |
name: publish coverage report | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
repository: theforeman/foreman_fog_proxmox | |
path: foreman_fog_proxmox | |
- name: Download tests result from test | |
uses: actions/download-artifact@v1 | |
with: | |
name: coverage | |
path: foreman_fog_proxmox/coverage | |
- name: Publish code coverage to codeclimate | |
uses: paambaati/[email protected] | |
env: | |
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}} | |
GIT_BRANCH: ${{ github.ref }} | |
GIT_COMMIT_SHA: ${{ github.sha }} | |
with: | |
workingDirectory: ${{github.workspace}}/foreman_fog_proxmox | |
debug: true | |
coverageLocations: | | |
${{github.workspace}}/foreman_fog_proxmox/coverage/coverage.json:simplecov |