Skip to content

Commit

Permalink
Update GitHub Actions workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
StefSchenkelaars committed Apr 23, 2021
1 parent 5b3749b commit ffb5bcf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 71 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Check out code
uses: actions/checkout@v2

- name: Login to GitHub Packages
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login -u ${GITHUB_ACTOR} --password-stdin docker.pkg.github.com

- name: Build the tagged Docker image
run: docker build . --tag docker.pkg.github.com/drieam/ltilauncher/lti-launcher:${GITHUB_REF##*/}

- name: Push the tagged Docker image
run: docker push docker.pkg.github.com/drieam/ltilauncher/lti-launcher:${GITHUB_REF##*/}
83 changes: 13 additions & 70 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,67 +4,29 @@ jobs:
brakeman:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- uses: actions/cache@v1
id: cache
with:
path: vendor/bundle
key: ${{ runner.os }}-bundler-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-bundler-
- name: Check out code
uses: actions/checkout@v2

- name: Setup Ruby
uses: eregon/use-ruby-action@master
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.1

# required to compile pg ruby gem
- name: install PostgreSQL client
if: steps.cache.outputs.cache-hit != 'true'
run: sudo apt-get install libpq-dev

- name: Install gems
run: |
gem install bundler -v "$(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -n 1)" --no-doc
bundle config specific_platform x86_64-linux
bundle config --local build.sassc --disable-march-tune-native
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
bundler-cache: true

- name: Run brakeman
run: bundle exec brakeman

rubocop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- uses: actions/cache@v1
id: cache
with:
path: vendor/bundle
key: ${{ runner.os }}-bundler-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-bundler-
- name: Check out code
uses: actions/checkout@v2

- name: Setup Ruby
uses: eregon/use-ruby-action@master
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.1

# required to compile pg ruby gem
- name: install PostgreSQL client
if: steps.cache.outputs.cache-hit != 'true'
run: sudo apt-get install libpq-dev

- name: Install gems
run: |
gem install bundler -v "$(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -n 1)" --no-doc
bundle config specific_platform x86_64-linux
bundle config --local build.sassc --disable-march-tune-native
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
bundler-cache: true

- name: Run rubocop
run: bundle exec rubocop
Expand All @@ -73,7 +35,7 @@ jobs:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:11
image: postgres:12
ports:
# will assign a random free host port
- 5432/tcp
Expand All @@ -86,33 +48,14 @@ jobs:
POSTGRES_HOST_AUTH_METHOD: trust

steps:
- uses: actions/checkout@v1

- uses: actions/cache@v1
id: cache
with:
path: vendor/bundle
key: ${{ runner.os }}-bundler-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-bundler-
- name: Check out code
uses: actions/checkout@v2

- name: Setup Ruby
uses: eregon/use-ruby-action@master
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.1

# required to compile pg ruby gem
- name: install PostgreSQL client
if: steps.cache.outputs.cache-hit != 'true'
run: sudo apt-get install libpq-dev

- name: Install gems
run: |
gem install bundler -v "$(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -n 1)" --no-doc
bundle config specific_platform x86_64-linux
bundle config --local build.sassc --disable-march-tune-native
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
bundler-cache: true

- name: Run RSpec
env:
Expand Down

0 comments on commit ffb5bcf

Please sign in to comment.