Merge pull request #374 from cs169/187436622-commercials-embed-snap #954
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: Specs | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
linters: | |
continue-on-error: true | |
runs-on: ubuntu-latest | |
env: | |
PRONTO_PULL_REQUEST_ID: ${{ github.event.pull_request.number }} | |
PRONTO_GITHUB_ACCESS_TOKEN: "${{ github.token }}" | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.2.2 | |
bundler-cache: true | |
# - name: Run Pronto | |
# run: bundle exec pronto run | |
# run: pronto run -f github_combined_status github_pr_review -c origin/${{ github.base_ref }} | |
- run: bundle exec rubocop | |
- run: bundle exec haml-lint app/views | |
spec: | |
continue-on-error: true | |
runs-on: ubuntu-latest | |
name: spec | |
env: | |
OSEM_DB_ADAPTER: sqlite3 | |
RAILS_ENV: test | |
CCTR: ./cc-test-reporter | |
CCTR_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | |
strategy: | |
matrix: | |
suite: [models, features, controllers, ability, leftovers, cucumber] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.2.2 | |
bundler-cache: true | |
- name: Use Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '16.x' | |
- run: sudo apt-get install xvfb | |
- name: Install JavaScript libraries via npm | |
run: npm install | |
- name: set up CodeClimate test-reporter | |
run: | | |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > $CCTR | |
chmod +x $CCTR | |
$CCTR before-build | |
- name: Prepare spec | |
run: | | |
rm -f osem_test osem_development | |
bundle exec rake db:setup --trace | |
bundle exec bin/rails webdrivers:chromedriver:update | |
bundle exec rake factory_bot:lint RAILS_ENV=test | |
# TODO: Not all suites need xvfb | |
- name: spec/${{ matrix.suite }} | |
run: | | |
xvfb-run --auto-servernum bundle exec rake spec:${{ matrix.suite }} | |
$CCTR format-coverage --output coverage/codeclimate.${{ matrix.suite }}.json --input-type simplecov | |
# - name: coverage upload ${{ matrix.suite }} | |
# uses: codacy/codacy-coverage-reporter-action@v1 | |
# if: github.ref == 'refs/heads/master' && always() | |
# with: | |
# project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
# coverage-reports: coverage/coverage.xml | |
- name: Upload Capybara Failure Screenshots | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: capybara-screenshots | |
path: tmp/capybara/ | |
retention-days: 7 | |
- name: Publish code coverage | |
run: | | |
export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}" | |
$CCTR sum-coverage coverage/codeclimate.*.json | |
$CCTR upload-coverage --id "6d21ff1a59b134f3741779d50325f7bd5183cbe6b205051573d955705148960f" | |
$CCTR after-build --id "6d21ff1a59b134f3741779d50325f7bd5183cbe6b205051573d955705148960f" |