Merge pull request #388 from inaturalist/dependabot/npm_and_yarn/word… #557
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: iNaturalstAPI CI | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
services: | |
postgres: | |
image: postgis/postgis:11-2.5 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: inaturalist_test | |
ports: | |
- 5432:5432 | |
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16.x' | |
- name: Configure sysctl limits | |
run: | | |
sudo swapoff -a | |
sudo sysctl -w vm.swappiness=1 | |
sudo sysctl -w fs.file-max=262144 | |
sudo sysctl -w vm.max_map_count=262144 | |
- name: Runs Elasticsearch | |
uses: miyataka/elastic-github-actions/elasticsearch@feature/plugin_support | |
with: | |
stack-version: 7.17.1 | |
plugins: analysis-kuromoji | |
- name: Elasticsearch is reachable | |
run: | | |
curl --verbose --show-error http://localhost:9200 | |
- name: Copy config | |
run: | | |
cp config.js.ci config.js | |
touch vision-taxa.txt | |
- run: npm install | |
- run: npm run coverage | |
env: | |
PGHOST: 0.0.0.0 | |
PGUSER: postgres | |
PGPASSWORD: postgres | |
CI: true | |
notify: | |
name: Notify Slack | |
needs: build | |
if: ${{ success() || failure() }} | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: iRoachie/[email protected] | |
if: env.SLACK_WEBHOOK_URL != null | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_BUILDS_WEBHOOK_URL }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |