Skip to content

Commit

Permalink
use shared github workflow to run tests (#866)
Browse files Browse the repository at this point in the history
* use shared github workflow to run tests

* replace rubocop deps with theforeman-rubocop

* drop build_container flows, we don't need them anymore

* run tests against foreman 3.9 and develop
  • Loading branch information
evgeni authored Mar 10, 2024
1 parent cff1136 commit d8fb53e
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 1,173 deletions.
5 changes: 0 additions & 5 deletions .github/actions/action.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/images/.pnpmfile.cjs

This file was deleted.

66 changes: 0 additions & 66 deletions .github/images/Dockerfile

This file was deleted.

19 changes: 0 additions & 19 deletions .github/images/docker-compose.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions .github/images/entrypoint.sh

This file was deleted.

11 changes: 0 additions & 11 deletions .github/images/npm_install_plugins.js

This file was deleted.

36 changes: 0 additions & 36 deletions .github/images/run_tests.sh

This file was deleted.

38 changes: 0 additions & 38 deletions .github/workflows/build_container.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/build_container_pr.yml

This file was deleted.

76 changes: 22 additions & 54 deletions .github/workflows/ruby_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,63 +2,31 @@ name: Ruby tests
on:
push:
branches: [foreman_3_9]
paths-ignore:
- '**/.github/**/*'
pull_request:
branches: [foreman_3_9]
paths-ignore:
- '**/.github/**/*'

defaults:
run:
working-directory: /projects/foreman

jobs:
test_ruby:
defaults:
run:
working-directory: /projects/foreman
env:
PGHOST: postgres
PGUSER: foreman
PGPASS: foreman
RAILS_ENV: test
host: postgres
WORKDIR: /projects/foreman
BUNDLE_PATH: vendor/bundle
GIT_COMMITTER_NAME: "gh_actions"
GIT_COMMITTER_EMAIL: "gh_actions@rh_cloud.foreman"

runs-on: ubuntu-latest
container:
image: ghcr.io/theforeman/tfm_plugin_test:foreman_3_9
concurrency:
group: ${{ github.ref_name }}-${{ github.workflow }}
cancel-in-progress: true

services:
postgres:
image: quay.io/jomitsch/postgres-with-evr
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_USER: foreman
POSTGRES_PASSWORD: foreman
jobs:
rubocop:
name: Rubocop
uses: theforeman/actions/.github/workflows/rubocop.yml@v0

steps:
- name: Checkout foreman_rh_cloud repo
uses: actions/checkout@v2
with:
path: ${{ github.workspace }}/projects/foreman_rh_cloud
- name: Fix git config
run: |
rm -rf /projects/foreman_rh_cloud/{app,test,lib}
cp -Rf $GITHUB_WORKSPACE/projects/foreman_rh_cloud /projects/
/usr/bin/entrypoint.sh pnpm config set store-dir /root/.local/share/pnpm/store/v3
cd /projects/foreman
/usr/bin/entrypoint.sh git config --global user.name $GIT_COMMITTER_NAME
/usr/bin/entrypoint.sh git config --global user.email $GIT_COMMITTER_EMAIL
- name: Run tests suite
run: |
cd /projects/foreman
/usr/bin/entrypoint.sh /usr/bin/run_tests.sh
test:
name: Ruby
needs: rubocop
strategy:
fail-fast: false
matrix:
foreman:
- 3.9-stable
- develop
uses: theforeman/actions/.github/workflows/foreman_plugin.yml@v0
with:
plugin: foreman_rh_cloud
postgresql_container: ghcr.io/theforeman/postgresql-evr
test_existing_database: false
foreman_version: ${{ matrix.foreman }}
Loading

0 comments on commit d8fb53e

Please sign in to comment.