-
Notifications
You must be signed in to change notification settings - Fork 151
GitHub actions #370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GitHub actions #370
Changes from 27 commits
c8e7bed
126dda7
e2a3445
79eae87
836e391
f24988d
034658c
9235332
2f6fb95
bd53bba
39af7ad
0f56b27
0c30773
3a4b89c
7a94cd0
bac4346
2b4aa04
0fd6d63
b7dca43
e5e9b25
6b8ad88
89ce90b
aad4b0d
394b054
229dad9
ec48ef2
42bacd8
4991c91
af32ef5
2cfa162
bebda64
4bd8149
5e7fb2b
2f4a94b
8415122
e87b0f9
e508a63
4462e28
815add0
ccbc6e2
2ea0a15
4c7ec51
74cc2f7
6f0ba78
a75e09f
84493f4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,80 @@ | ||||||
on: push | ||||||
|
||||||
jobs: | ||||||
code-quality: | ||||||
runs-on: ubuntu-latest | ||||||
steps: | ||||||
- uses: actions/checkout@v2 | ||||||
- uses: erlef/setup-beam@v1 | ||||||
with: | ||||||
# Just some default versions to run code quality tools with. | ||||||
# These can be upgraded as and when but probably won't need to change much. | ||||||
otp-version: "24.0.6" | ||||||
elixir-version: "1.12.3" | ||||||
- uses: actions/cache@v2 | ||||||
with: | ||||||
path: | | ||||||
deps | ||||||
_build | ||||||
priv/plts | ||||||
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} | ||||||
joeapearson marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
restore-keys: | | ||||||
${{ runner.os }}-mix- | ||||||
- run: mix deps.get | ||||||
- run: mix credo --strict | ||||||
continue-on-error: true | ||||||
- run: mix format --check-formatted | ||||||
continue-on-error: true | ||||||
- run: mix dialyzer | ||||||
test: | ||||||
strategy: | ||||||
matrix: | ||||||
os: | ||||||
- ubuntu-latest | ||||||
otp-version: | ||||||
- "24.0.6" | ||||||
elixir-version: | ||||||
- "1.12.3" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should probably setup an actual matrix and test previous versions of Elixir and OTP as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep. Any suggestions for that? I was starting simple so at least there is something in place as we go forward. |
||||||
mongo-version: | ||||||
- maj: 4 | ||||||
min: 4 | ||||||
patch: 8 | ||||||
runs-on: ${{ matrix.os }} | ||||||
steps: | ||||||
- uses: actions/checkout@v2 | ||||||
- uses: erlef/setup-beam@v1 | ||||||
with: | ||||||
otp-version: ${{ matrix.otp-version }} | ||||||
elixir-version: ${{ matrix.elixir-version }} | ||||||
- uses: actions/cache@v2 | ||||||
with: | ||||||
path: | | ||||||
deps | ||||||
_build | ||||||
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If there is a proper matrix of Elixir and OTP versions, you will want to include the versions in the cache key in order to pull the proper cache version. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, more important here. I'll fix. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I think this is what @ankhers is suggesting! |
||||||
restore-keys: | | ||||||
${{ runner.os }}-mix- | ||||||
- name: Install Mongo | ||||||
run: | | ||||||
# See https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/ | ||||||
|
||||||
# Import MongoDB public key | ||||||
wget -qO - https://www.mongodb.org/static/pgp/server-${{ matrix.mongo-version.maj }}.${{ matrix.mongo-version.min }}.asc | sudo apt-key add - | ||||||
|
||||||
# Create a list file for MongoDB | ||||||
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/${{ matrix.mongo-version.maj }}.${{ matrix.mongo-version.min }} multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-${{ matrix.mongo-version.maj }}.${{ matrix.mongo-version.min }}.list | ||||||
|
||||||
# Update package db | ||||||
sudo apt-get update | ||||||
|
||||||
# Finally install mongodb | ||||||
sudo apt-get install -y \ | ||||||
--allow-downgrades \ | ||||||
mongodb-org=${{ matrix.mongo-version.maj }}.${{ matrix.mongo-version.min }}.${{ matrix.mongo-version.patch }} \ | ||||||
mongodb-org-server=${{ matrix.mongo-version.maj }}.${{ matrix.mongo-version.min }}.${{ matrix.mongo-version.patch }} \ | ||||||
mongodb-org-shell=${{ matrix.mongo-version.maj }}.${{ matrix.mongo-version.min }}.${{ matrix.mongo-version.patch }} \ | ||||||
mongodb-org-mongos=${{ matrix.mongo-version.maj }}.${{ matrix.mongo-version.min }}.${{ matrix.mongo-version.patch }} \ | ||||||
mongodb-org-tools=${{ matrix.mongo-version.maj }}.${{ matrix.mongo-version.min }}.${{ matrix.mongo-version.patch }} | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe instead of this, you can look at what one of the official mongo drivers uses to start mongo. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh excellent find. Agreed. |
||||||
- name: Start Mongo | ||||||
run: ./start_mongo.bash | ||||||
- run: mix test --cover |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Contributing | ||
|
||
Thanks for considering making a contribution to `mongodb`! | ||
|
||
## Getting started | ||
|
||
1. Clone this repository | ||
2. Install mongodb and make sure it's available on `$PATH` | ||
3. Run `start_mongo.bash` | ||
joeapearson marked this conversation as resolved.
Show resolved
Hide resolved
|
||
4. Run `mix test` | ||
|
||
|
||
## What's next? | ||
|
||
1. Take a look at our [open issues](https://github.com/elixir-mongo/mongodb/issues) | ||
2. Create a new issue or open a discussion for larger topics. |
Uh oh!
There was an error while loading. Please reload this page.