|
1 | 1 | name: CI
|
2 |
| -on: [push, pull_request] |
3 |
| -env: |
4 |
| - RAILS_ENV: test |
5 |
| - DATABASE_URL: postgresql://postgres:@localhost/test |
6 |
| - DATABASE_CLEANER_ALLOW_REMOTE_DATABASE_URL: true |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - master |
| 8 | + |
| 9 | +concurrency: |
| 10 | + group: ${{ github.ref_name }}-${{ github.workflow }} |
| 11 | + cancel-in-progress: true |
| 12 | + |
7 | 13 | jobs:
|
8 | 14 | rubocop:
|
9 |
| - runs-on: ubuntu-latest |
10 |
| - steps: |
11 |
| - - uses: actions/checkout@v3 |
12 |
| - - name: Setup Ruby |
13 |
| - uses: ruby/setup-ruby@v1 |
14 |
| - with: |
15 |
| - ruby-version: 2.7 |
16 |
| - - name: Setup |
17 |
| - run: | |
18 |
| - gem install bundler -v 2.4.22 |
19 |
| - echo "gem 'rdoc', '< 6.4'" >> Gemfile |
20 |
| - bundle install --jobs=3 --retry=3 |
21 |
| - - name: Run rubocop |
22 |
| - run: bundle exec rubocop |
| 15 | + name: Rubocop |
| 16 | + uses: theforeman/actions/.github/workflows/rubocop.yml@v0 |
| 17 | + |
23 | 18 | test:
|
24 |
| - runs-on: ubuntu-latest |
25 |
| - needs: rubocop |
26 |
| - services: |
27 |
| - postgres: |
28 |
| - image: postgres:12.1 |
29 |
| - ports: ['5432:5432'] |
30 |
| - options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 |
31 |
| - strategy: |
32 |
| - fail-fast: false |
33 |
| - matrix: |
34 |
| - foreman-core-branch: [3.1-stable, 3.2-stable, 3.3-stable, 3.4-stable, 3.5-stable, 3.6-stable, develop] |
35 |
| - ruby-version: [2.7] |
36 |
| - node-version: [14] |
37 |
| - steps: |
38 |
| - - name: Install dependencies |
39 |
| - run: | |
40 |
| - sudo apt-get update |
41 |
| - sudo apt-get install build-essential libcurl4-openssl-dev libvirt-dev ruby-libvirt zlib1g-dev libpq-dev |
42 |
| - - uses: actions/checkout@v3 |
43 |
| - with: |
44 |
| - repository: theforeman/foreman |
45 |
| - ref: ${{ matrix.foreman-core-branch }} |
46 |
| - - uses: actions/checkout@v3 |
47 |
| - with: |
48 |
| - path: foreman_vault |
49 |
| - - name: Setup Ruby |
50 |
| - uses: ruby/setup-ruby@v1 |
51 |
| - with: |
52 |
| - ruby-version: ${{ matrix.ruby-version }} |
53 |
| - - name: Setup Node |
54 |
| - uses: actions/setup-node@v3 |
55 |
| - with: |
56 |
| - node-version: ${{ matrix.node-version }} |
57 |
| - - name: Setup Bundler |
58 |
| - run: | |
59 |
| - gem install bundler -v 2.4.22 |
60 |
| - bundle config path vendor/bundle |
61 |
| - bundle config set without journald development console mysql2 sqlite |
62 |
| - echo "gem 'foreman_vault', path: './foreman_vault'" > bundler.d/foreman_vault.local.rb |
63 |
| - bundle lock --update |
64 |
| - - name: Cache gems |
65 |
| - uses: actions/cache@v3 |
66 |
| - with: |
67 |
| - path: vendor/bundle |
68 |
| - key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} |
69 |
| - restore-keys: | |
70 |
| - ${{ runner.os }}-gems- |
71 |
| - - name: Setup Plugin |
72 |
| - run: | |
73 |
| - bundle install --jobs=3 --retry=3 |
74 |
| - bundle exec rake db:create |
75 |
| - bundle exec rake db:migrate |
76 |
| - npm install |
77 |
| - bundle exec rake webpack:compile |
78 |
| - - name: Run plugin tests |
79 |
| - run: | |
80 |
| - bundle exec rake test:foreman_vault |
81 |
| - bundle exec rake test TEST="test/unit/foreman/access_permissions_test.rb" |
82 |
| - - name: Precompile plugin assets |
83 |
| - run: bundle exec rake 'plugin:assets:precompile[foreman_vault]' |
84 |
| - env: |
85 |
| - RAILS_ENV: production |
| 19 | + name: Ruby |
| 20 | + # needs: rubocop |
| 21 | + uses: theforeman/actions/.github/workflows/foreman_plugin.yml@v0 |
| 22 | + with: |
| 23 | + plugin: foreman_vault |
0 commit comments