fix: workflow for coverage upload to codeclimate #601
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint, Test, Coverage and Deploy | |
on: | |
push: | |
branches: | |
- main | |
- beta | |
pull_request: | |
jobs: | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
# ruby-version: ["3.0", "3.1", "3.2"] | |
ruby-version: [ "3.2" ] | |
packages: | |
# - forest_admin_agent | |
- forest_admin_datasource_active_record | |
# - forest_admin_datasource_customizer | |
# - forest_admin_datasource_toolkit | |
# - forest_admin_test_toolkit | |
# - forest_admin_rails | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Ruby ${{ matrix.ruby-version }} | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby-version }} | |
- name: Install dependencies on main repo | |
run: | | |
gem install bundler | |
bundle install | |
- name: Install dependencies on packages | |
run: cd packages/${{ matrix.packages }} && bundle install && cd - | |
- name: Run RuboCop | |
run: bundle exec rubocop | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
needs: [lint] | |
strategy: | |
matrix: | |
# ruby-version: ["3.0", "3.1", "3.2"] | |
ruby-version: [ "3.2" ] | |
packages: | |
# - forest_admin_agent | |
- forest_admin_datasource_active_record | |
# - forest_admin_datasource_customizer | |
# - forest_admin_datasource_toolkit | |
# - forest_admin_rails | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Ruby ${{ matrix.ruby-version }} | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby-version }} | |
- name: Install dependencies on main repo | |
run: | | |
gem install bundler | |
bundle install | |
- name: Test | |
run: cd packages/${{ matrix.packages }} && BUNDLE_GEMFILE=Gemfile-test bundle install && BUNDLE_GEMFILE=Gemfile-test bundle exec rspec --color --format doc && cd - | |
- name: test debug main Directory | |
run: tree -a coverage/ | |
- name: Debug Coverage Directory | |
run: tree -a packages/${{ matrix.packages }}/coverage/ | |
- name: Debug file structure | |
run: tree -a packages/forest_admin_datasource_active_record | |
- name: Verify coverage.json presence | |
run: | | |
if [ -f packages/forest_admin_datasource_active_record/coverage/coverage.json ]; then | |
echo "Coverage file exists" | |
else | |
echo "Coverage file is missing" | |
fi | |
# - name: Upload coverage | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: ${{ matrix.ruby-version }}-${{ matrix.packages }} | |
# path: packages/${{ matrix.packages }}/coverage/* | |
# retention-days: 1 | |
# coverage: | |
# name: Send Coverage | |
# runs-on: ubuntu-latest | |
# needs: [test] | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@v4 | |
# | |
# - name: Download coverage reports | |
# uses: actions/download-artifact@v4 | |
# with: | |
# path: reports | |
- name: Send coverage | |
uses: paambaati/[email protected] | |
env: | |
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | |
with: | |
coverageLocations: | | |
${{github.workspace}}/packages/${{ matrix.packages }}/coverage/coverage.json:simplecov | |
# ${{github.workspace}}/reports/3.2-forest_admin_datasource_active_record/coverage.json:simplecov | |
debug: true | |
# deploy: | |
# name: Release package | |
# runs-on: ubuntu-latest | |
# needs: [coverage] | |
# if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta') | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@v4 | |
# with: | |
# persist-credentials: false # GITHUB_TOKEN must not be set for the semantic release | |
# | |
# - uses: actions/setup-node@v4 | |
# with: | |
# node-version: 18.14.0 | |
# | |
# - uses: actions/cache@v4 | |
# with: | |
# path: "**/node_modules" | |
# key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} | |
# | |
# - name: Install semantic release dependencies | |
# run: yarn | |
# | |
# - name: Setup credentials | |
# run: | | |
# mkdir -p $HOME/.gem | |
# touch $HOME/.gem/credentials | |
# chmod 0600 $HOME/.gem/credentials | |
# printf -- "---\n:rubygems_api_key: ${{secrets.GEM_HOST_API_KEY}}\n" > $HOME/.gem/credentials | |
# | |
# - name: Semantic Release | |
# uses: cycjimmy/semantic-release-action@v2 | |
# id: semantic | |
# with: | |
# semantic_version: 17.3.0 | |
# env: | |
# GEM_HOST_API_KEY: ${{ secrets.GEM_HOST_API_KEY }} | |
# GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
# GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }} | |
# GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }} | |
# GIT_COMMITTER_EMAIL: ${{ secrets.GIT_COMMITTER_EMAIL }} | |
# GIT_COMMITTER_NAME: ${{ secrets.GIT_COMMITTER_NAME }} | |
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} |