Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

Ubuntu 22.04

Ubuntu 22.04 #40

Workflow file for this run

name: Ubuntu 22.04
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: '0 3 * * 6'
jobs:
install:
if: |
(
github.event_name == 'workflow_dispatch' ||
github.event_name == 'schedule' ||
contains(github.event.head_commit.message, '[install all]') ||
contains(github.event.head_commit.message, '[install ubuntu]') ||
contains(github.event.head_commit.message, '[install ubuntu 22.04]')
)
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
steps:
- name: Install script
env:
NO_COVERAGE_REPORT: 1
run: |
sudo apt purge postgresql* postgis* -y # For CI only
set -e
set -x
sudo rm -rf /usr/bin/firefox
curl -sL 'https://download.mozilla.org/?product=firefox-latest-ssl&os=linux64&lang=en-US' | \
sudo tar -xjf - -C /usr/bin # Also for CI only, regular Ubuntu Desktop install comes with Firefox from Snapcraft
export PATH=/usr/bin/firefox/:$PATH
which firefox
sudo apt update -y && sudo apt dist-upgrade -y
echo "deb [arch=amd64] http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" | sudo tee -a /etc/apt/sources.list.d/pgdg.list
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install -y postgresql-15 postgresql-contrib-15 libgeos-dev libproj-dev postgresql-15-postgis-3 postgresql-15-postgis-3-scripts libpq-dev cmake imagemagick libmagickwand-dev tesseract-ocr git meld curl
sudo -u postgres createuser -s -d -w taxonworks_development # Replaced -P with -w since prompt cannot be answered in this context
sudo sed -i.bak 's/local\s*all\s*all\s*peer/local all all trust/' /etc/postgresql/15/main/pg_hba.conf
sudo service postgresql restart
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
sudo apt-get update
sudo apt-get install nodejs -y
gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
curl -sSL https://get.rvm.io | bash -s stable
source /home/runner/.rvm/scripts/rvm
mkdir Projects
cd Projects
git clone https://github.com/SpeciesFileGroup/taxonworks.git
cd taxonworks
git checkout master
rvm reload # For CI only
rvm install $(cat .ruby-version)
cd . # Refreshes rvm to pick up recently installed ruby above
ruby -v
gem install bundler
bundle
npm install
cp config/database.yml.example config/database.yml
cp config/secrets.yml.example config/secrets.yml
bundle exec rake db:create && bundle exec bin/rails db:environment:set RAILS_ENV=development
bundle exec rake db:migrate && bundle exec rake db:test:prepare
cp config/application_settings.yml.ci config/application_settings.yml
TMPDIR=$(pwd)/tmp bundle exec rake