Skip to content

Commit 27c561b

Browse files
Update ci files
1 parent 5b72470 commit 27c561b

6 files changed

Lines changed: 63 additions & 193 deletions

File tree

.github/workflows/ci_age_action_authorization.yml

Lines changed: 12 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,19 @@ on:
88
- "*-stable"
99
pull_request:
1010

11-
env:
12-
RUBY_VERSION: 3.2.6
13-
1411
jobs:
1512
test-report:
1613
runs-on: ubuntu-latest
1714

15+
env:
16+
BUNDLE_GEMFILE: ${{ github.workspace }}/decidim-age_action_authorization/Gemfile
17+
DATABASE_USERNAME: postgres
18+
DATABASE_PASSWORD: postgres
19+
DATABASE_HOST: localhost
20+
1821
services:
1922
postgres:
20-
image: postgres:11
23+
image: postgres:14
2124
ports: ["5432:5432"]
2225
options: >-
2326
--health-cmd pg_isready
@@ -26,41 +29,16 @@ jobs:
2629
--health-retries 5
2730
env:
2831
POSTGRES_PASSWORD: postgres
29-
env:
30-
DATABASE_USERNAME: postgres
31-
DATABASE_PASSWORD: postgres
32-
DATABASE_HOST: localhost
32+
3333
steps:
3434
- uses: actions/checkout@v4
3535
with:
3636
fetch-depth: 1
3737

38-
- uses: ruby/setup-ruby@master
39-
with:
40-
ruby-version: ${{ env.RUBY_VERSION }}
41-
42-
- name: Recover Ruby dependency cache
43-
uses: actions/cache@v4
38+
- uses: ruby/setup-ruby@v1
4439
with:
45-
path: ./vendor/bundle
46-
key: ${{ runner.OS }}-rubydeps-${{ hashFiles('Gemfile.lock') }}
47-
restore-keys: |
48-
${{ runner.OS }}-rubydeps-${{ env.cache-name }}-
49-
${{ runner.OS }}-rubydeps-
50-
${{ runner.OS }}-
51-
52-
- name: Set bundle local config vendor/bundle path
53-
run: bundle config set --local path 'vendor/bundle'
54-
55-
- name: Install Ruby deps
56-
uses: nick-invision/retry@v3
57-
with:
58-
timeout_minutes: 10
59-
max_attempts: 3
60-
retry_on: error
61-
command: |
62-
cd decidim-age_action_authorization
63-
bundle install --jobs 4 --retry 3
40+
ruby-version-file: .ruby-version
41+
bundler-cache: true
6442

6543
- name: Generate age_action_authorization test_app
6644
run: |
@@ -70,7 +48,7 @@ jobs:
7048
RAILS_ENV=test bundle exec rails db:migrate
7149
7250
- name: Run RSpec
73-
uses: nick-invision/retry@v3
51+
uses: nick-fields/retry@v3
7452
with:
7553
timeout_minutes: 10
7654
max_attempts: 3

.github/workflows/ci_app.yml

Lines changed: 11 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,13 @@ on:
88
- "*-stable"
99
pull_request:
1010

11-
env:
12-
RUBY_VERSION: 3.2.6
13-
NODE_VERSION: 18.17.1
14-
1511
jobs:
1612
test:
1713
runs-on: ubuntu-latest
1814

1915
services:
2016
postgres:
21-
image: postgres:11
17+
image: postgres:14
2218
ports: ["5432:5432"]
2319
options: >-
2420
--health-cmd pg_isready
@@ -37,41 +33,25 @@ jobs:
3733
with:
3834
fetch-depth: 1
3935

40-
- uses: ruby/setup-ruby@master
36+
- uses: ruby/setup-ruby@v1
4137
with:
42-
ruby-version: ${{ env.RUBY_VERSION }}
38+
ruby-version-file: .ruby-version
39+
bundler-cache: true
4340

44-
- name: Recover Ruby dependency cache
45-
uses: actions/cache@v4
41+
- uses: actions/setup-node@v4
4642
with:
47-
path: ./vendor/bundle
48-
key: ${{ runner.OS }}-app-rubydeps-${{ hashFiles('Gemfile.lock') }}
49-
restore-keys: |
50-
${{ runner.OS }}-app-rubydeps-${{ env.cache-name }}-
51-
${{ runner.OS }}-app-rubydeps-
43+
node-version-file: package.json
44+
cache: npm
5245

53-
- name: Set bundle local config vendor/bundle path
54-
run: bundle config set --local path 'vendor/bundle'
46+
- run: npm install
5547

56-
- name: Install Ruby deps
57-
uses: nick-invision/retry@v3
58-
with:
59-
timeout_minutes: 10
60-
max_attempts: 3
61-
retry_on: error
62-
command: bundle install --jobs 4 --retry 3
48+
- run: sudo apt update && sudo apt install -y imagemagick
6349

64-
- uses: actions/setup-node@v4
65-
with:
66-
node-version: ${{ env.NODE_VERSION }}
67-
cache: 'npm'
68-
- run: npm install
69-
- run: |
70-
sudo apt update && sudo apt install imagemagick
7150
- run: bundle exec rake db:test:prepare
7251
name: Setup database
52+
7353
- name: Run RSpec
74-
uses: nick-invision/retry@v3
54+
uses: nick-fields/retry@v3
7555
with:
7656
timeout_minutes: 10
7757
max_attempts: 3

.github/workflows/ci_census.yml

Lines changed: 12 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,19 @@ on:
88
- "*-stable"
99
pull_request:
1010

11-
env:
12-
RUBY_VERSION: 3.2.6
13-
1411
jobs:
1512
test-report:
1613
runs-on: ubuntu-latest
1714

15+
env:
16+
BUNDLE_GEMFILE: ${{ github.workspace }}/decidim-census/Gemfile
17+
DATABASE_USERNAME: postgres
18+
DATABASE_PASSWORD: postgres
19+
DATABASE_HOST: localhost
20+
1821
services:
1922
postgres:
20-
image: postgres:11
23+
image: postgres:14
2124
ports: ["5432:5432"]
2225
options: >-
2326
--health-cmd pg_isready
@@ -26,41 +29,16 @@ jobs:
2629
--health-retries 5
2730
env:
2831
POSTGRES_PASSWORD: postgres
29-
env:
30-
DATABASE_USERNAME: postgres
31-
DATABASE_PASSWORD: postgres
32-
DATABASE_HOST: localhost
32+
3333
steps:
3434
- uses: actions/checkout@v4
3535
with:
3636
fetch-depth: 1
3737

38-
- uses: ruby/setup-ruby@master
38+
- uses: ruby/setup-ruby@v1
3939
with:
40-
ruby-version: ${{ env.RUBY_VERSION }}
41-
42-
- name: Recover Ruby dependency cache
43-
uses: actions/cache@v4
44-
with:
45-
path: ./vendor/bundle
46-
key: ${{ runner.OS }}-rubydeps-${{ hashFiles('Gemfile.lock') }}
47-
restore-keys: |
48-
${{ runner.OS }}-rubydeps-${{ env.cache-name }}-
49-
${{ runner.OS }}-rubydeps-
50-
${{ runner.OS }}-
51-
52-
- name: Set bundle local config vendor/bundle path
53-
run: bundle config set --local path 'vendor/bundle'
54-
55-
- name: Install Ruby deps
56-
uses: nick-invision/retry@v3
57-
with:
58-
timeout_minutes: 10
59-
max_attempts: 3
60-
retry_on: error
61-
command: |
62-
cd decidim-census
63-
bundle install --jobs 4 --retry 3
40+
ruby-version-file: .ruby-version
41+
bundler-cache: true
6442

6543
- name: Generate census test_app
6644
run: |
@@ -71,7 +49,7 @@ jobs:
7149
RAILS_ENV=test bundle exec rails db:migrate
7250
7351
- name: Run RSpec
74-
uses: nick-invision/retry@v3
52+
uses: nick-fields/retry@v3
7553
with:
7654
timeout_minutes: 10
7755
max_attempts: 3

.github/workflows/ci_diba_census_api.yml

Lines changed: 12 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,19 @@ on:
88
- "*-stable"
99
pull_request:
1010

11-
env:
12-
RUBY_VERSION: 3.2.6
13-
1411
jobs:
1512
test-report:
1613
runs-on: ubuntu-latest
1714

15+
env:
16+
BUNDLE_GEMFILE: ${{ github.workspace }}/decidim-diba_census_api/Gemfile
17+
DATABASE_USERNAME: postgres
18+
DATABASE_PASSWORD: postgres
19+
DATABASE_HOST: localhost
20+
1821
services:
1922
postgres:
20-
image: postgres:11
23+
image: postgres:14
2124
ports: ["5432:5432"]
2225
options: >-
2326
--health-cmd pg_isready
@@ -26,41 +29,16 @@ jobs:
2629
--health-retries 5
2730
env:
2831
POSTGRES_PASSWORD: postgres
29-
env:
30-
DATABASE_USERNAME: postgres
31-
DATABASE_PASSWORD: postgres
32-
DATABASE_HOST: localhost
32+
3333
steps:
3434
- uses: actions/checkout@v4
3535
with:
3636
fetch-depth: 1
3737

38-
- uses: ruby/setup-ruby@master
38+
- uses: ruby/setup-ruby@v1
3939
with:
40-
ruby-version: ${{ env.RUBY_VERSION }}
41-
42-
- name: Recover Ruby dependency cache
43-
uses: actions/cache@v4
44-
with:
45-
path: ./vendor/bundle
46-
key: ${{ runner.OS }}-rubydeps-${{ hashFiles('Gemfile.lock') }}
47-
restore-keys: |
48-
${{ runner.OS }}-rubydeps-${{ env.cache-name }}-
49-
${{ runner.OS }}-rubydeps-
50-
${{ runner.OS }}-
51-
52-
- name: Set bundle local config vendor/bundle path
53-
run: bundle config set --local path 'vendor/bundle'
54-
55-
- name: Install Ruby deps
56-
uses: nick-invision/retry@v3
57-
with:
58-
timeout_minutes: 10
59-
max_attempts: 3
60-
retry_on: error
61-
command: |
62-
cd decidim-diba_census_api
63-
bundle install --jobs 4 --retry 3
40+
ruby-version-file: .ruby-version
41+
bundler-cache: true
6442

6543
- name: Generate diba_census_api test_app
6644
run: |
@@ -71,7 +49,7 @@ jobs:
7149
RAILS_ENV=test bundle exec rails db:migrate
7250
7351
- name: Run RSpec
74-
uses: nick-invision/retry@v3
52+
uses: nick-fields/retry@v3
7553
with:
7654
timeout_minutes: 10
7755
max_attempts: 3

.github/workflows/ci_ldap.yml

Lines changed: 13 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,19 @@ on:
88
- "*-stable"
99
pull_request:
1010

11-
env:
12-
RUBY_VERSION: 3.2.6
13-
1411
jobs:
1512
test-report:
1613
runs-on: ubuntu-latest
1714

15+
env:
16+
BUNDLE_GEMFILE: ${{ github.workspace }}/decidim-ldap/Gemfile
17+
DATABASE_USERNAME: postgres
18+
DATABASE_PASSWORD: postgres
19+
DATABASE_HOST: localhost
20+
1821
services:
1922
postgres:
20-
image: postgres:11
23+
image: postgres:14
2124
ports: ["5432:5432"]
2225
options: >-
2326
--health-cmd pg_isready
@@ -26,53 +29,28 @@ jobs:
2629
--health-retries 5
2730
env:
2831
POSTGRES_PASSWORD: postgres
29-
env:
30-
DATABASE_USERNAME: postgres
31-
DATABASE_PASSWORD: postgres
32-
DATABASE_HOST: localhost
32+
3333
steps:
3434
- uses: actions/checkout@v4
3535
with:
3636
fetch-depth: 1
3737

38-
- uses: ruby/setup-ruby@master
38+
- uses: ruby/setup-ruby@v1
3939
with:
40-
ruby-version: ${{ env.RUBY_VERSION }}
41-
42-
- name: Recover Ruby dependency cache
43-
uses: actions/cache@v4
44-
with:
45-
path: ./vendor/bundle
46-
key: ${{ runner.OS }}-rubydeps-${{ hashFiles('Gemfile.lock') }}
47-
restore-keys: |
48-
${{ runner.OS }}-rubydeps-${{ env.cache-name }}-
49-
${{ runner.OS }}-rubydeps-
50-
${{ runner.OS }}-
51-
52-
- name: Set bundle local config vendor/bundle path
53-
run: bundle config set --local path 'vendor/bundle'
54-
55-
- name: Install Ruby deps
56-
uses: nick-invision/retry@v3
57-
with:
58-
timeout_minutes: 10
59-
max_attempts: 3
60-
retry_on: error
61-
command: |
62-
cd decidim-ldap
63-
bundle install --jobs 4 --retry 3
40+
ruby-version-file: .ruby-version
41+
bundler-cache: true
6442

6543
- name: Generate ldap test_app
6644
run: |
67-
sudo apt update && sudo apt install imagemagick
45+
sudo apt update && sudo apt install -y imagemagick
6846
cd decidim-ldap
6947
bundle exec rake test_app
7048
cd spec/decidim_dummy_app/
7149
bundle exec rails decidim_ldap:install:migrations
7250
RAILS_ENV=test bundle exec rails db:migrate
7351
7452
- name: Run RSpec
75-
uses: nick-invision/retry@v3
53+
uses: nick-fields/retry@v3
7654
with:
7755
timeout_minutes: 10
7856
max_attempts: 3

0 commit comments

Comments
 (0)