Skip to content

Merge pull request #320 from egose/renovate/go.mongodb.org-mongo-driv… #1194

Merge pull request #320 from egose/renovate/go.mongodb.org-mongo-driv…

Merge pull request #320 from egose/renovate/go.mongodb.org-mongo-driv… #1194

Workflow file for this run

name: Test codebase
on: push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-22.04
steps:
- uses: hmarr/debug-action@f7318c783045ac39ed9bb497e22ce835fdafbfe6
- uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2
- name: Setup Tools
uses: ./.github/actions/setup-tools
- name: Setup NPM Packages
uses: ./.github/actions/setup-yarn
- name: Install Docker Compose v2
# See https://docs.docker.com/compose/install/linux/
run: |
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p $DOCKER_CONFIG/cli-plugins
curl -SL https://github.com/docker/compose/releases/download/v2.27.1/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
docker compose version
- name: Run test
run: |
mkdir -p ./sandbox/mnt/mongodb
mkdir -p ./sandbox/mnt/minio
mkdir -p ./sandbox/mnt/azurite
mkdir -p ./sandbox/mnt/fake-gcs-server
cp .env.example .env.test
export MACHINE_HOST_IP=$(hostname -I | awk '{print $1}')
~/.docker/cli-plugins/docker-compose --env-file .env.test -f sandbox/docker-compose.yml -f sandbox/docker-compose-ci.yml up -d
node_modules/.bin/wait-on tcp::27017 --timeout 120000
node_modules/.bin/wait-on http://localhost:9001 --timeout 120000
bats test
~/.docker/cli-plugins/docker-compose --env-file .env.test -f sandbox/docker-compose.yml -f sandbox/docker-compose-ci.yml down
sudo rm -rf ./sandbox/mnt
#
# Keep old test script
# - name: Run test
# run: |
# mkdir -p ./dist/mongo/db
# mongod --fork --dbpath ./dist/mongo/db --logpath ./dist/mongo/mongod.log
#
# until nc -z 127.0.0.1 27017
# do
# echo "Waiting for MongoDB to be ready..."
# sleep 1
# done
#
# bats test