Skip to content

Commit a077d75

Browse files
authored
Merge pull request #1 from appwrite/initial-push
Initial Version
2 parents 308f52c + 15094d6 commit a077d75

16 files changed

+5067
-1
lines changed

Diff for: .cargo/config.toml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[target.'cfg(not(target_os = "windows"))']
2+
rustflags = ["-C", "link-arg=-Wl,-undefined,dynamic_lookup"]
3+
4+
[target.x86_64-pc-windows-msvc]
5+
linker = "rust-lld"
6+
7+
[target.i686-pc-windows-msvc]
8+
linker = "rust-lld"

Diff for: .github/workflows/clippy.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
on: push
2+
name: Clippy check
3+
jobs:
4+
clippy_check:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v1
8+
- run: rustup component add clippy
9+
- uses: actions-rs/clippy-check@v1
10+
with:
11+
token: ${{ secrets.GITHUB_TOKEN }}
12+
args: --all-features

Diff for: .github/workflows/tests.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: "Tests"
2+
3+
on: [pull_request]
4+
jobs:
5+
tests:
6+
name: Alpine & GNU Tests
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout repository
11+
uses: actions/checkout@v2
12+
with:
13+
# We must fetch at least the immediate parents so that if this is
14+
# a pull request then we can checkout the head.
15+
fetch-depth: 2
16+
17+
# If this run was triggered by a pull request event, then checkout
18+
# the head of the pull request instead of the merge commit.
19+
- run: git checkout HEAD^2
20+
if: ${{ github.event_name == 'pull_request' }}
21+
22+
- name: Build Extension
23+
run: |
24+
docker pull composer:2.0
25+
docker pull php:8.0.18-cli
26+
docker pull php:8.0.18-cli-alpine3.15
27+
docker compose build --progress=plain
28+
docker compose up -d
29+
sleep 10
30+
- name: Run Tests (GNU Based Linux)
31+
run: docker compose exec -T tests_gnu sh -c "cd /src/ && /src/vendor/bin/phpunit"
32+
33+
- name: Run Tests (Alpine Linux)
34+
run: docker compose exec -T tests_alpine sh -c "cd /src/ && /src/vendor/bin/phpunit"

Diff for: .gitignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Generated by Cargo
2+
# will have compiled files and executables
3+
/target/
4+
5+
# These are backup files generated by rustfmt
6+
**/*.rs.bk
7+
8+
9+
.DS_Store
10+
11+
/.vscode/
12+
/vendor/
13+
/node_modules/
14+
/tests/resources/storage/
15+
/tests/resources/functions/**/code.tar.gz
16+
/app/sdks/*
17+
/.idea/
18+
.DS_Store
19+
.php_cs.cache
20+
debug/
21+
app/sdks
22+
dev/yasd_init.php
23+
*.cache

Diff for: CONTRIBUTING.md

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Contributing
2+
3+
We would ❤️ for you to contribute to Appwrite and help make it better! As a contributor, here are the guidelines we would like you to follow:
4+
5+
## Code of Conduct
6+
7+
Help us keep Appwrite open and inclusive. Please read and follow our [Code of Conduct](/CODE_OF_CONDUCT.md).
8+
9+
## Submit a Pull Request 🚀
10+
11+
12+
Branch naming convention is as following
13+
14+
`TYPE-ISSUE_ID-DESCRIPTION`
15+
16+
example:
17+
18+
```
19+
doc-548-submit-a-pull-request-section-to-contribution-guide
20+
```
21+
22+
When `TYPE` can be:
23+
24+
- **feat** - is a new feature
25+
- **doc** - documentation only changes
26+
- **cicd** - changes related to CI/CD system
27+
- **fix** - a bug fix
28+
- **refactor** - code change that neither fixes a bug nor adds a feature
29+
30+
**All PRs must include a commit message with the changes description!**
31+
32+
For the initial start, fork the project and use git clone command to download the repository to your computer. A standard procedure for working on an issue would be to:
33+
34+
1. `git pull`, before creating a new branch, pull the changes from upstream. Your master needs to be up to date.
35+
36+
```
37+
$ git pull
38+
```
39+
40+
2. Create new branch from `master` like: `doc-548-submit-a-pull-request-section-to-contribution-guide`<br/>
41+
42+
```
43+
$ git checkout -b [name_of_your_new_branch]
44+
```
45+
46+
3. Work - commit - repeat ( be sure to be in your branch )
47+
48+
4. Before you push your changes, make sure your code follows the `Rustfmt` coding standards , which is the standard Appwrite follows currently. You can easily do this by running the formatter.
49+
50+
```bash
51+
cargo fmt
52+
```
53+
54+
If the `cargo fmt` command does not work then run the following to install rustfmt:
55+
56+
```bash
57+
rustup component add rustfmt
58+
```
59+
60+
This will give you a list of errors for you to rectify
61+
62+
1. Push changes to GitHub
63+
64+
```
65+
$ git push origin [name_of_your_new_branch]
66+
```
67+
68+
6. Submit your changes for review
69+
If you go to your repository on GitHub, you'll see a `Compare & pull request` button. Click on that button.
70+
7. Start a Pull Request
71+
Now submit the pull request and click on `Create pull request`.
72+
8. Get a code review approval/reject
73+
9. After approval, merge your PR
74+
10. GitHub will automatically delete the branch after the merge is done. (they can still be restored).
75+
76+
77+
## Running Tests
78+
Tests are run with Docker in order to test both alpine builds and GNU linux builds, Docker Compose is also required.
79+
80+
Bring up the testing containers using:
81+
```bash
82+
docker compose up -d --force-recreate --build
83+
```
84+
85+
Then run the tests using
86+
```bash
87+
docker compose exec -T tests_gnu sh -c "cd /src/ && /src/vendor/bin/phpunit"
88+
89+
docker compose exec -T tests_alpine sh -c "cd /src/ && /src/vendor/bin/phpunit"
90+
```
91+
92+
The first command tests GNU based machines and the second one tests alpine, both must pass before the PR is merged.

0 commit comments

Comments
 (0)