From deb92ad9db1da2cdb83b8344ddb269de0b3e32a0 Mon Sep 17 00:00:00 2001 From: Valeri Karpov Date: Sun, 4 Sep 2022 19:53:35 -0400 Subject: [PATCH] add github workflows --- .github/workflows/test.yml | 44 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..eefa6d6 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,44 @@ +name: Test +on: + pull_request: + push: +permissions: + contents: read + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + node: [12, 14, 16, 17] + os: [ubuntu-18.04, ubuntu-20.04] + include: + - os: ubuntu-18.04 + mongo-os: ubuntu1804 + mongo: 4.0.2 + - os: ubuntu-20.04 + mongo-os: ubuntu2004 + mongo: 5.0.2 + name: Node ${{ matrix.node }} MongoDB ${{ matrix.mongo }} + steps: + - uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846 # v3 + + - name: Setup node + uses: actions/setup-node@5b52f097d36d4b0b2f94ed6de710023fbb8b2236 # v3.1.0 + with: + node-version: ${{ matrix.node }} + + - run: npm install + + - name: Setup + run: | + wget -q https://downloads.mongodb.org/linux/mongodb-linux-x86_64-${{ matrix.mongo-os }}-${{ matrix.mongo }}.tgz + tar xf mongodb-linux-x86_64-${{ matrix.mongo-os }}-${{ matrix.mongo }}.tgz + mkdir -p ./data/db/27017 ./data/db/27000 + printf "\n--timeout 8000" >> ./test/mocha.opts + ./mongodb-linux-x86_64-${{ matrix.mongo-os }}-${{ matrix.mongo }}/bin/mongod --setParameter ttlMonitorSleepSecs=1 --fork --dbpath ./data/db/27017 --syslog --port 27017 + sleep 2 + mongod --version + echo `pwd`/mongodb-linux-x86_64-${{ matrix.mongo-os }}-${{ matrix.mongo }}/bin >> $GITHUB_PATH + - run: npm test