Skip to content

Commit

Permalink
Extract out OS and language versions as variables
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamineskola committed Jun 6, 2024
1 parent 912da6f commit 2e20362
Showing 1 changed file with 52 additions and 48 deletions.
100 changes: 52 additions & 48 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ on:
pull_request:
branches: [master]

env:
RUBY_VERSION: "$RUBY_VERSION"
OS_VERSION: "ubuntu-24.04"

jobs:
bundle-audit:
runs-on: ubuntu-24.04
runs-on: $OS_VERSION

services:
postgres:
Expand All @@ -32,15 +36,15 @@ jobs:
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
ruby-version: "$RUBY_VERSION"

- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-24.04-gems-${{ hashFiles('/Gemfile.lock') }}
key: $OS_VERSION-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-24.04-gems-
$OS_VERSION-gems-
- name: Setup
uses: ./.github/actions/setup
Expand All @@ -50,7 +54,7 @@ jobs:
bundle exec rake bundle:audit
brakeman:
runs-on: ubuntu-24.04
runs-on: $OS_VERSION

services:
postgres:
Expand All @@ -74,15 +78,15 @@ jobs:
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
ruby-version: "$RUBY_VERSION"

- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-24.04-gems-${{ hashFiles('/Gemfile.lock') }}
key: $OS_VERSION-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-24.04-gems-
$OS_VERSION-gems-
- name: Setup
uses: ./.github/actions/setup
Expand All @@ -92,7 +96,7 @@ jobs:
bundle exec rake brakeman:check
spec-admin-controllers:
runs-on: ubuntu-24.04
runs-on: $OS_VERSION

services:
postgres:
Expand All @@ -116,15 +120,15 @@ jobs:
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
ruby-version: "$RUBY_VERSION"

- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-24.04-gems-${{ hashFiles('/Gemfile.lock') }}
key: $OS_VERSION-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-24.04-gems-
$OS_VERSION-gems-
- name: Setup
uses: ./.github/actions/setup
Expand All @@ -138,7 +142,7 @@ jobs:
bundle exec rake spec:controllers
spec-public-controllers:
runs-on: ubuntu-24.04
runs-on: $OS_VERSION

services:
postgres:
Expand All @@ -162,15 +166,15 @@ jobs:
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
ruby-version: "$RUBY_VERSION"

- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-24.04-gems-${{ hashFiles('/Gemfile.lock') }}
key: $OS_VERSION-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-24.04-gems-
$OS_VERSION-gems-
- name: Setup
uses: ./.github/actions/setup
Expand All @@ -184,7 +188,7 @@ jobs:
bundle exec rake spec:controllers
spec-jobs:
runs-on: ubuntu-24.04
runs-on: $OS_VERSION

services:
postgres:
Expand All @@ -208,15 +212,15 @@ jobs:
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
ruby-version: "$RUBY_VERSION"

- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-24.04-gems-${{ hashFiles('/Gemfile.lock') }}
key: $OS_VERSION-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-24.04-gems-
$OS_VERSION-gems-
- name: Setup
uses: ./.github/actions/setup
Expand All @@ -230,7 +234,7 @@ jobs:
bundle exec rake spec:jobs
spec-mailers:
runs-on: ubuntu-24.04
runs-on: $OS_VERSION

services:
postgres:
Expand All @@ -254,15 +258,15 @@ jobs:
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
ruby-version: "$RUBY_VERSION"

- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-24.04-gems-${{ hashFiles('/Gemfile.lock') }}
key: $OS_VERSION-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-24.04-gems-
$OS_VERSION-gems-
- name: Setup
uses: ./.github/actions/setup
Expand All @@ -276,7 +280,7 @@ jobs:
bundle exec rake spec
spec-models:
runs-on: ubuntu-24.04
runs-on: $OS_VERSION

services:
postgres:
Expand All @@ -300,15 +304,15 @@ jobs:
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
ruby-version: "$RUBY_VERSION"

- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-24.04-gems-${{ hashFiles('/Gemfile.lock') }}
key: $OS_VERSION-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-24.04-gems-
$OS_VERSION-gems-
- name: Setup
uses: ./.github/actions/setup
Expand All @@ -322,7 +326,7 @@ jobs:
bundle exec rake spec
spec-requests:
runs-on: ubuntu-24.04
runs-on: $OS_VERSION

services:
postgres:
Expand All @@ -346,15 +350,15 @@ jobs:
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
ruby-version: "$RUBY_VERSION"

- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-24.04-gems-${{ hashFiles('/Gemfile.lock') }}
key: $OS_VERSION-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-24.04-gems-
$OS_VERSION-gems-
- name: Setup
uses: ./.github/actions/setup
Expand All @@ -368,7 +372,7 @@ jobs:
bundle exec rake spec
spec-other:
runs-on: ubuntu-24.04
runs-on: $OS_VERSION

services:
postgres:
Expand All @@ -392,15 +396,15 @@ jobs:
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
ruby-version: "$RUBY_VERSION"

- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-24.04-gems-${{ hashFiles('/Gemfile.lock') }}
key: $OS_VERSION-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-24.04-gems-
$OS_VERSION-gems-
- name: Setup
uses: ./.github/actions/setup
Expand All @@ -414,7 +418,7 @@ jobs:
bundle exec rake spec
javascript:
runs-on: ubuntu-24.04
runs-on: $OS_VERSION

services:
postgres:
Expand All @@ -438,15 +442,15 @@ jobs:
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
ruby-version: "$RUBY_VERSION"

- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-24.04-gems-${{ hashFiles('/Gemfile.lock') }}
key: $OS_VERSION-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-24.04-gems-
$OS_VERSION-gems-
- name: Setup
uses: ./.github/actions/setup
Expand All @@ -459,7 +463,7 @@ jobs:
bundle exec rake jasmine:ci
cucumber-admin:
runs-on: ubuntu-24.04
runs-on: $OS_VERSION

services:
postgres:
Expand All @@ -483,15 +487,15 @@ jobs:
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
ruby-version: "$RUBY_VERSION"

- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-24.04-gems-${{ hashFiles('/Gemfile.lock') }}
key: $OS_VERSION-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-24.04-gems-
$OS_VERSION-gems-
- name: Setup
uses: ./.github/actions/setup
Expand Down Expand Up @@ -524,7 +528,7 @@ jobs:
bundle exec rake cucumber
cucumber-public:
runs-on: ubuntu-24.04
runs-on: $OS_VERSION

services:
postgres:
Expand All @@ -548,15 +552,15 @@ jobs:
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
ruby-version: "$RUBY_VERSION"

- name: Setup gem cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ubuntu-24.04-gems-${{ hashFiles('/Gemfile.lock') }}
key: $OS_VERSION-gems-${{ hashFiles('/Gemfile.lock') }}
restore-keys: |
ubuntu-24.04-gems-
$OS_VERSION-gems-
- name: Setup
uses: ./.github/actions/setup
Expand Down

0 comments on commit 2e20362

Please sign in to comment.