Skip to content

Use assets.exercism.org subdomain #292

Use assets.exercism.org subdomain

Use assets.exercism.org subdomain #292

Workflow file for this run

name: Tests
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
services:
aws:
image: "localstack/localstack"
ports:
- 4566
redis:
image: redis
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 1s
--health-timeout 2s
--health-retries 10
steps:
###
# Checkout using GitHub's checkout action
- uses: actions/checkout@v2
###
# Setup Ruby - this needs to match the version in the Gemfile
- name: Set up Ruby
uses: ruby/setup-ruby@6cecb48364174b0952995175c55f9bf5527e6682
with:
ruby-version: "3.2.1"
bundler-cache: true
###
# Install bundler and yarn dependencies
- name: Install dependencies
env:
EXERCISM_ENV: test
EXERCISM_CI: true
AWS_PORT: ${{ job.services.aws.ports['4566'] }}
run: |
bundle exec setup_exercism_config
bundle exec setup_exercism_local_aws
###
# Setup code climate
- name: Setup Code Climate test-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
###
# Run the tests
- name: Run Ruby tests
env:
EXERCISM_ENV: test
EXERCISM_CI: true
AWS_PORT: ${{ job.services.aws.ports['4566'] }}
CAPTURE_CODE_COVERAGE: true
run: |
bundle exec rake test
./cc-test-reporter format-coverage -t simplecov -o codeclimate.backend.json coverage/backend/.resultset.json
###
# Publish the coverage to CodeClimate
- name: Publish code coverage
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
env:
GIT_BRANCH: ${GITHUB_REF/refs\/heads\//}
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
run: |
./cc-test-reporter upload-coverage -i codeclimate.*.json