feat: import samples additional attributes - flash point and refractive index #4019
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: Continuous Integration | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- main | |
jobs: | |
linting: | |
if: github.event.pull_request && (github.triggering_actor != 'dependabot[bot]') | |
runs-on: ubuntu-latest | |
env: | |
PRONTO_PULL_REQUEST_ID: ${{ github.event.pull_request.number }} | |
steps: | |
- name: checkout repository | |
uses: actions/checkout@v4 | |
- run: | | |
git fetch --no-tags --prune --unshallow origin +refs/heads/*:refs/remotes/origin/* | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.3.0' | |
- name: install linting dependencies | |
run: gem install rubocop pronto pronto-rubocop rubocop-rspec rubocop-rails rubocop-performance | |
- name: run Pronto | |
run: pronto run -f github_status github_pr_review -c origin/${{ github.base_ref }} | |
env: | |
PRONTO_GITHUB_ACCESS_TOKEN: "${{ github.token }}" | |
if: github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name # don't run on PRs from forks because of missing write permission: https://github.com/orgs/community/discussions/26829 | |
- name: run Pronto on fork | |
# We cannot use the `github_status` formatter on forks in order to report the linting status, | |
# since the formatter requires write access, which isn't the default on forks. | |
# This is why we're using the `--exit-code` flag, which causes Pronto to propagate non-zero exit codes, | |
# i.e., we can use the `--exit-code` flag to fail the linting job in case Pronto reports warning or errors (https://github.com/prontolabs/pronto). | |
run: pronto run --exit-code -f text -c origin/${{ github.base_ref }} | |
if: github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name | |
testing: | |
needs: [linting] | |
if: always() && (needs.linting.result == 'success' || needs.linting.result == 'skipped') # https://github.com/actions/runner/issues/491 | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
container: complat/chemotion_eln_runner:main | |
services: | |
postgres: | |
image: postgres:16 # https://hub.docker.com/_/postgres | |
env: | |
POSTGRES_PASSWORD: postgres # env variable required by postgres Docker container | |
POSTGRES_USER: chemotion # optional env variable used in conjunction with POSTGRES_PASSWORD to set a user and their password | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: checkout repository | |
uses: actions/checkout@v3 | |
- name: create user for datacollectors testing | |
run: | | |
useradd testuser -m -s /bin/bash | |
mkdir /home/testuser/.ssh | |
chown testuser:testuser /home/testuser/.ssh | |
chmod 700 /home/testuser/.ssh | |
- name: configure ssh for datacollectors testing | |
run: | | |
service ssh restart | |
mkdir -p $HOME/.ssh | |
chmod 700 $HOME/.ssh | |
ssh-keygen -t ed25519 -f $HOME/.ssh/id_test -N "" | |
# echo "$(<$HOME/.ssh/id_test.pub)" >> $HOME/.ssh/authorized_keys | |
echo "$(<$HOME/.ssh/id_test.pub)" | sudo tee -a /home/testuser/.ssh/authorized_keys | |
eval `ssh-agent` | |
ssh-add $HOME/.ssh/id_test | |
ssh-keyscan -H 127.0.0.1 >> $HOME/.ssh/known_hosts | |
- name: configure repository | |
run: | | |
mv public/welcome-message-sample.md public/welcome-message.md | |
cd config | |
cp database.yml.gitlab database.yml | |
cp -f datacollectors.yml.example datacollectors.yml | |
cp -f profile_default.yml.example profile_default.yml | |
cp -f shrine.yml.example shrine.yml | |
cp -f storage.yml.example storage.yml | |
cp -f radar.yml.example radar.yml | |
touch klasses.json | |
bundle config set without '' | |
- name: configure postgres | |
env: | |
PG_ROLE: chemotion_test | |
PG_ROLE_PASSWORD: 123456 | |
PG_DATABASE: chemotion_test | |
PGPASSWORD: postgres # env variable required by psql client | |
run: | # host is service container name | |
psql -h postgres -U chemotion -c "CREATE ROLE $PG_ROLE LOGIN CREATEDB NOSUPERUSER PASSWORD '$PG_ROLE_PASSWORD';" | |
psql -h postgres -U chemotion -c "CREATE DATABASE $PG_DATABASE OWNER $PG_ROLE;" | |
psql -d postgresql://$PG_ROLE:$PG_ROLE_PASSWORD@postgres/$PG_DATABASE -c 'CREATE EXTENSION IF NOT EXISTS "pg_trgm"; CREATE EXTENSION IF NOT EXISTS "hstore"; CREATE EXTENSION IF NOT EXISTS "uuid-ossp";' | |
- name: bundle install | |
run: bundle install | |
- name: yarn install | |
run: yarn install --production=false | |
- name: prepare postgres | |
run: | | |
RAILS_ENV=test bundle exec rake db:migrate | |
RAILS_ENV=test bundle exec rake db:test:prepare | |
RAILS_ENV=test bundle exec rake db:seed | |
- name: npm test | |
run: npm test | |
- name: rspec unit | |
run: | | |
eval `ssh-agent` | |
ssh-add $HOME/.ssh/id_test | |
RAILS_ENV=test bundle exec rspec --exclude-pattern spec/{features}/**/*_spec.rb spec | |
- name: coverage rspec unit | |
if: github.event.pull_request && (github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name) && (github.triggering_actor != 'dependabot[bot]') # don't run on PRs from forks because of missing write permission: https://github.com/orgs/community/discussions/26829 | |
uses: zgosalvez/github-actions-report-lcov@v1 | |
with: | |
coverage-files: coverage/lcov/${{ github.event.repository.name }}.lcov | |
minimum-coverage: 57 | |
artifact-name: code-coverage-report | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
# - name: precompile | |
# run: RAILS_ENV=test bundle exec rake webpacker:compile | |
# - name: rspec acceptance | |
# continue-on-error: true # don't fail job because this step; TODO: fix flaky acceptance tests... | |
# run: RAILS_ENV=test bundle exec rspec spec/features | |