fix upgrade mongo version test to 6 #223
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: test | ||
Check failure on line 1 in .github/workflows/main.yml GitHub Actions / testInvalid workflow file
|
||
on: | ||
push: | ||
pull_request: | ||
jobs: | ||
skip: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: echo "Skip job" | ||
before: | ||
runs-on: ubuntu-latest | ||
if: ! contains(github.event.head_commit.message, '[skip ci]') | ||
steps: | ||
- run: echo "not contains '[skip ci]'" | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
#- windows-latest | ||
#- macOS-latest | ||
nim-version: | ||
- '1.4.0' | ||
- '1.6.14' # stable is already v2 but this hasn't supported that yet | ||
# - 'stable' | ||
needs: before | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Cache nimble | ||
id: cache-nimble | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.nimble | ||
key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }} | ||
- uses: jiro4989/setup-nim-action@v1 | ||
with: | ||
nim-version: ${{ matrix.nim-version }} | ||
# see. https://github.com/actions/virtual-environments/issues/675 | ||
- name: Fix apt packages | ||
run: | | ||
sudo sed -i 's/azure\.//' /etc/apt/sources.list | ||
sudo apt update -yqq | ||
# https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/ | ||
- name: Install mongodb | ||
run: | | ||
sudo apt-get install gnupg | ||
curl -fsSL https://pgp.mongodb.com/server-6.0.asc | \ | ||
sudo gpg -o /usr/share/keyrings/mongodb-server-6.0.gpg \ | ||
--dearmor | ||
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list | ||
sudo apt-get update -yqq | ||
sudo apt-get install -y mongodb-org | ||
# - name: Start mongodb | ||
# run: | | ||
# sudo systemctl start mongod | ||
# sleep 10 | ||
- run: nimble install -Y | ||
# Disabling running mongod since mongod is already running with systemctl | ||
# Disabling test gridfs because no big file available, by setting filename and saveas to blank | ||
# Disabling authenticating since the installed mongo is pristine without setting up the user and password | ||
- name: Nimble test setup and run | ||
run: | | ||
# echo 'switch("define", "nomongod")' > config.nims | ||
mkdir /tmp/mongodbpath | ||
echo 'switch("define", "filename=")' > config.nims | ||
echo 'switch("define", "filename=")' >> config.nims | ||
echo 'switch("define", "saveas=")' >> config.nims | ||
echo 'switch("define", "user=")' >> config.nims | ||
echo 'switch("define", "testReplication=yes")' >> config.nims | ||
echo 'switch("define", "testChangeStreams=yes")' >> config.nims | ||
echo 'hint("ConvFromXToItSelfNotNeeded", off)' >> config.nims | ||
echo 'switch("define", "dbpath=/tmp/mongodbpath")' >> config.nims | ||
echo 'switch("define", "uri")' >> config.nims | ||
nimble test -Y | ||
- uses: actions/checkout@v2.3.1 | ||
- run: nim doc --project --index:on --git.url:https://github.com/mashingan/anonimongo --outdir:src/htmldocs src/anonimongo.nim | ||
- name: Deploy docs | ||
uses: JamesIves/github-pages-deploy-action@v4.4.1 | ||
with: | ||
branch: gh-pages | ||
folder: . |