Update backend dependencies (#215) #610
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: Tests | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
tests: | |
name: Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Ruby and install gems | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.3.5' | |
bundler-cache: true | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pytest | |
if [ -f services/requirements.txt ]; then pip install -r services/requirements.txt; fi | |
pip install -e services | |
pip list | |
- name: Cache Thrift | |
id: cache-thrift | |
uses: actions/cache@v3 | |
with: | |
path: install | |
key: ${{ runner.os }}-thrift-0.20.0-cache | |
- name: Make Thrift Compiler | |
if: steps.cache-thrift.outputs.cache-hit != 'true' | |
run: | | |
export THRIFT_VERSION=0.20.0 | |
export buildDeps="automake bison curl flex g++ libboost-dev libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libboost-test-dev libevent-dev libssl-dev libtool make pkg-config" | |
sudo apt-get install -y --no-install-recommends $buildDeps && sudo rm -rf /var/lib/apt/lists/* | |
curl -sSL "http://archive.apache.org/dist/thrift/$THRIFT_VERSION/thrift-$THRIFT_VERSION.tar.gz" -o thrift.tar.gz | |
mkdir -p thrift | |
mkdir -p install | |
tar zxf thrift.tar.gz -C ${PWD}/thrift --strip-components=1 | |
cd thrift | |
./configure --prefix=${PWD}/../install --without-c_glib --without-csharp --without-python --without-netstd --without-erlang --without-rs --without-swift --without-dotnetcore --without-cpp --without-ruby --without-nodejs --without-py3 --without-go --without-php --without-java --without-haskell | |
make | |
make install | |
cd .. | |
ls -al install/* | |
- name: Check Thrift install | |
run: | | |
echo $PWD | |
ls -al | |
ls -al install/* | |
echo "${PWD}/install/bin" >> $GITHUB_PATH | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
cache: 'yarn' | |
- name: Install packages | |
run: | | |
yarn install --pure-lockfile | |
- name: Configure rails app | |
run: | | |
cp config/configuration.yml.example config/configuration.yml | |
cp config/database.yml.example config/database.yml | |
mkdir -p upload/store | |
mkdir -p upload/logs | |
RAILS_ENV=test bundle exec rake db:schema:load | |
bundle exec rake db:test:prepare | |
RAILS_ENV=test bundle exec rake shakapacker:compile | |
- name: Run tests | |
run: | | |
echo $PATH | |
WHATSOPT_COVERALLS=1 bundle exec rails test --verbose | |
- name: Coveralls | |
uses: coverallsapp/github-action@v2 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: "./coverage/lcov.info" | |