Skip to content

Commit

Permalink
Prepare files for release v3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bhekanik committed Jan 26, 2020
1 parent 2a02472 commit 35930bc
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 15 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM bhekanik/firebase:latest

LABEL version="1.0.0"
LABEL version="3.0.0"
LABEL repository="https://github.com/IIIMPACT/firebase-firestore-testing-action.git"
LABEL homepage="https://github.com/IIIMPACT/firebase-firestore-testing-action.git"
LABEL maintainer="Bhekani Khumalo <bhekani@iiimpact.io>"
LABEL maintainer="Bhekani Khumalo <bhekani@gmail.com>"

LABEL com.github.actions.name="Firebase Firestore Testing"
LABEL com.github.actions.description="Test firestore with the emulators and jest."
LABEL com.github.actions.name="Jest testing (including firestore rules)"
LABEL com.github.actions.description="Run jest to test code, this includes the firebase firestore emulator to make it possible to also test firestore rules."
LABEL com.github.actions.icon="airplay"
LABEL com.github.actions.color="orange"

Expand Down
46 changes: 44 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,45 @@
# firebase-firestore-testing-action
## Jest testing (including firestore rules)

This action allows you to use the firestore emulator and jest to test firestore rules in ci
This action runs jest to test code. It also includes the firebase firestore emulator to make it possible to also test firestore rules.

## Assumptions

This action assumes that:

* Your file structure contains a folder in the root directory called `funcitons` which contains all your functions code.
* You have the following npm scripts in your `package.json`:

```javascript
...
"scripts": {
"test": "jest",
"test:ci": "firebase emulators:exec --only firestore \"npm run test\"",
}
...
```

## Example

Here is an example yaml file to run the action:

```yaml
name: Test

on: [pull_request]

jobs:
test:
name: test
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v1

- name: Run Jest
uses: IIIMPACT/[email protected]
```
## License
The Dockerfile and associated scripts and documentation in this project are released under the [MIT License](LICENSE).
7 changes: 3 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# action.yml
name: 'Firebase Firestore Testing'
author: 'Bhekani Khumalo'
description: 'Test firestore with the emulators and jest.'
name: 'Jest testing (including firestore rules)'
author: 'Bhekani Khumalo <[email protected]>'
description: 'Run jest to test code, this includes the firebase firestore emulator to make it possible to also test firestore rules.'
branding:
icon: 'airplay'
color: 'orange'
Expand Down
6 changes: 1 addition & 5 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,5 @@ else
fi
fi

echo "## Starting emulator"
sh -c "firebase serve --only firestore"

echo "## Running Jest"
args=$@
sh -c "$setup npm --prefix functions run test:ci $args"
sh -c "$setup npm --prefix functions run test:ci"

0 comments on commit 35930bc

Please sign in to comment.