diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d6cdd6b2..97ef058f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,6 +48,7 @@ jobs: - 27017:27017 env: RAILS_ENV: test + COVERAGE: true steps: - name: Checkout code uses: actions/checkout@v3 @@ -58,4 +59,21 @@ jobs: with: bundler-cache: true - name: Run tests - run: bin/rspec + id: rspec + run: | + echo "::set-output name=exit_code::$(bin/rspec || echo $?)" + shell: bash + - name: Upload screenshots + if: steps.rspec.outputs.exit_code != '0' + uses: actions/upload-artifact@v2 + with: + name: screenshots + path: ./tmp/capybara + - name: Upload logs + if: steps.rspec.outputs.exit_code != '0' + uses: actions/upload-artifact@v2 + with: + name: rails-logs + path: ./log/test.log + - name: Coveralls + uses: coverallsapp/github-action@v2 diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 6330ea91..f9a3e9ab 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -13,6 +13,8 @@ on: workflows: ["Lint & Tests"] types: - completed + branches: + - main env: @@ -35,7 +37,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4.1.1 # Install the cosign tool except on PR # https://github.com/sigstore/cosign-installer diff --git a/README.md b/README.md index a6eee839..f533321b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ [![Tests](https://github.com/digitaltom/mapforge/actions/workflows/ci.yml/badge.svg)](https://github.com/digitaltom/mapforge/actions/workflows/ci.yml) [![Docker](https://github.com/digitaltom/mapforge/actions/workflows/docker-publish.yml/badge.svg)](https://github.com/digitaltom/mapforge/actions/workflows/docker-publish.yml) +[![Code Climate](https://codeclimate.com/github/digitaltom/mapforge.png)](https://codeclimate.com/github/digitaltom/mapforge) +[![Coverage Status](https://coveralls.io/repos/github/digitaltom/mapforge/badge.svg?branch=main)](https://coveralls.io/github/digitaltom/mapforge?branch=main) # README