mirror of
https://github.com/hakanensari/frankfurter.git
synced 2024-11-25 04:22:28 +01:00
Fix coverage in build script
This commit is contained in:
parent
1099346973
commit
efeecc4057
54
.github/workflows/build.yml
vendored
54
.github/workflows/build.yml
vendored
@ -1,54 +0,0 @@
|
||||
name: build
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
container:
|
||||
image: ruby:2.7.0
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:12
|
||||
ports:
|
||||
- 5432:5432
|
||||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: Set up reporter
|
||||
run: |
|
||||
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
||||
chmod +x ./cc-test-reporter
|
||||
./cc-test-reporter before-build
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
apt-get -yqq install libpq-dev
|
||||
gem install bundler
|
||||
bundle install --jobs 4 --retry 3
|
||||
|
||||
- name: Run tests
|
||||
run: bundle exec rake
|
||||
env:
|
||||
APP_ENV: test
|
||||
DATABASE_URL: postgres://postgres@postgres/postgres
|
||||
|
||||
- name: Publish image
|
||||
uses: elgohr/Publish-Docker-Github-Action@a72734e
|
||||
if: github.event_name == 'push' && success()
|
||||
with:
|
||||
name: hakanensari/frankfurter
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
tag_names: true
|
||||
|
||||
- name: Report to Code Climate
|
||||
continue-on-error: true
|
||||
run: GIT_BRANCH="${GITHUB_REF/refs\/heads\//}" ./cc-test-reporter after-build --exit-code $?
|
||||
env:
|
||||
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
|
||||
GIT_COMMIT_SHA: ${{ github.sha }}
|
38
.github/workflows/ci.yml
vendored
Normal file
38
.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
name: ci
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ruby:2.7
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:12
|
||||
ports:
|
||||
- 5432:5432
|
||||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: gem install bundler
|
||||
- run: bundle install --jobs 4 --retry 3
|
||||
- uses: paambaati/codeclimate-action@v2.4.0
|
||||
env:
|
||||
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
|
||||
DATABASE_URL: postgres://postgres@postgres/postgres
|
||||
with:
|
||||
coverageCommand: bundle exec rake
|
||||
|
||||
publish:
|
||||
needs: build
|
||||
if: github.event_name == 'push'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: elgohr/Publish-Docker-Github-Action@2.11
|
||||
with:
|
||||
name: hakanensari/frankfurter
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
tag_names: true
|
Loading…
Reference in New Issue
Block a user