Skip to content

Create .packit

Create .packit #200

Workflow file for this run

name: CI
on: [push, pull_request]
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby:
- '2.7'
foreman:
- 'develop'
services:
postgres:
image: postgres:14
env:
POSTGRES_USER: foreman
POSTGRES_PASSWORD: foreman
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
env:
BUNDLE_WITHOUT: "journald:development:mysql2:console"
TESTOPTS: "-v"
DATABASE_URL: "postgresql://foreman:foreman@localhost/test"
FOREMAN_PLUGIN_NAME: "foreman_azure_rm"
steps:
- name: Install package dependencies
run: |
sudo apt-get update
sudo apt-get install -yyq libsqlite3-dev zlib1g-dev libvirt-dev libcurl4-openssl-dev
- name: Checkout Foreman
uses: actions/checkout@v3
with:
repository: theforeman/foreman
ref: ${{ matrix.foreman }}
- name: Checkout Plugin
uses: actions/checkout@v3
with:
path: plugin
- name: Setup Plugin
run: echo "gemspec :path => './plugin'" > bundler.d/plugin.local.rb
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Set up NodeJS
uses: actions/setup-node@v3
with:
node-version: '12'
- name: Install NodeJS dependencies
run: npm install
- name: Run tests
run: |
bundle exec rake db:create RAILS_ENV=test
bundle exec rake webpack:compile
bundle exec rake db:migrate RAILS_ENV=test
bundle exec rake test:${FOREMAN_PLUGIN_NAME}
bundle exec rake "plugin:assets:precompile[${FOREMAN_PLUGIN_NAME}]" RAILS_ENV=production