-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
19 additions
and
62 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,67 +1,24 @@ | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- 'develop' | ||
- 'v*' | ||
|
||
concurrency: | ||
group: ${{ github.ref_name }}-${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
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@v4 | ||
with: | ||
repository: theforeman/foreman | ||
ref: ${{ matrix.foreman }} | ||
- name: Checkout Plugin | ||
uses: actions/checkout@v4 | ||
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@v4 | ||
with: | ||
node-version: '12' | ||
- name: Install NodeJS dependencies | ||
run: npm install | ||
rubocop: | ||
name: Rubocop | ||
uses: theforeman/actions/.github/workflows/rubocop.yml@v0 | ||
|
||
- 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 | ||
test: | ||
name: Ruby | ||
needs: rubocop | ||
uses: theforeman/actions/.github/workflows/foreman_plugin.yml@v0 | ||
with: | ||
plugin: foreman_azure_rm |