Skip to content

Commit

Permalink
ZFM-605 GHA eventboss
Browse files Browse the repository at this point in the history
  • Loading branch information
Michał Urban authored and Michał Urban committed Jan 26, 2023
1 parent 65392b9 commit 4dc98c9
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 54 deletions.
2 changes: 0 additions & 2 deletions .dockerignore

This file was deleted.

28 changes: 14 additions & 14 deletions .github/workflows/bundler_audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ on:
jobs:
run-bundler_audit:
name: Run bundler audit
runs-on: [self-hosted, utils]

runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ["3.0"]
steps:
- name: Check out repository code
uses: actions/checkout@v3

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- uses: actions/checkout@v2
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
registries: 158094083467

- name: Run tests
shell: bash
run: |
docker run --rm -v $(pwd):/usr/src/app 158094083467.dkr.ecr.eu-west-1.amazonaws.com/bundler-audit bundle audit --update
ruby-version: ${{ matrix.ruby-version }}
- name: Install bundle audit
run: gem install bundle-audit
- name: Update Ruby Advisory Database
run: bundle-audit update
- name: Run audit
run: bundle audit

49 changes: 12 additions & 37 deletions .github/workflows/rspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,44 +11,19 @@ env:
jobs:
run-tests:
name: Run RSpec
runs-on: [self-hosted, utils]

runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ["3.0"]
steps:
- name: Check out repository code
uses: actions/checkout@v3

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
with:
registries: 158094083467

- name: Set up Docker Context for Buildx
id: buildx-context
shell: bash
run: |
docker context create builders
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- uses: actions/checkout@v2
- name: Set up Ruby
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby
uses: ruby/setup-ruby@v1
with:
version: latest
endpoint: builders

- name: Build tests image
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile-test
tags: ${{ env.APPLICATION_NAME }}:rspec-tests-${{ github.sha }}
push: false
load: true
cache-from: type=gha
cache-to: type=gha,mode=max

ruby-version: ${{ matrix.ruby-version }}
# runs 'bundle install' and caches installed gems automatically
bundler-cache: true
- name: Run tests
shell: bash
run: |
docker run --rm \
-e "RAILS_ENV=test" \
-t ${{ env.APPLICATION_NAME }}:rspec-tests-${{ github.sha }} "bundle exec rspec"
run: bundle exec rspec

1 change: 0 additions & 1 deletion Dockerfile-test

This file was deleted.

0 comments on commit 4dc98c9

Please sign in to comment.