Finish deprecating organization from SnapCon changes #1036
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@v4 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
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_HOST: localhost | |
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@v4 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
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: | | |
bundle exec rake db:setup --trace | |
bundle exec bin/rails webdrivers:chromedriver:update | |
bundle exec rake factory_bot:lint RAILS_ENV=test | |
- name: spec/${{ matrix.suite }} | |
run: bundle exec rake spec:${{ matrix.suite }} | |
- name: format code coverage | |
run: | | |
$CCTR format-coverage --output coverage/codeclimate.${{ matrix.suite }}.json --input-type simplecov | |
- name: Upload Suite Artifacts | |
if: ${{ failure() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: logs-${{ matrix.suite }} | |
path: | | |
log/ | |
tmp/capybara | |
- name: coverage upload ${{ matrix.suite }} | |
uses: codacy/codacy-coverage-reporter-action@master | |
if: github.ref == 'refs/heads/master' | |
with: | |
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
coverage-reports: coverage/coverage.xml | |
# 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" | |
services: | |
postgres: | |
image: postgres:16-alpine | |
env: | |
POSTGRES_PASSWORD: mysecretpassword | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 |