Skip to content

Commit

Permalink
Merge branch 'main' into feature/week-20-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBitShepherd authored May 20, 2022
2 parents 2bdae04 + 8b0598e commit 4555d70
Show file tree
Hide file tree
Showing 5 changed files with 122 additions and 6 deletions.
18 changes: 12 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
version: 2
updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: weekly
day: sunday
open-pull-requests-limit: 0
- package-ecosystem: pip
directory: "/"
schedule:
interval: weekly
day: sunday
open-pull-requests-limit: 0
- package-ecosystem: npm
directory: "/"
schedule:
interval: weekly
day: wednesday
open-pull-requests-limit: 0
86 changes: 86 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Unit Tests

on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened] # Default

env:
SALESFORCE_CONSUMER_KEY: foo
SALESFORCE_CLIENT_SECRET: foo
DB_ENCRYPTION_KEY: ${{ secrets.DB_ENCRYPTION_KEY }}
DJANGO_HASHID_SALT: ${{ secrets.DJANGO_HASHID_SALT }}
DJANGO_SETTINGS_MODULE: config.settings.test
POSTGRES_PORT: 5432
REDIS_HOST: localhost
REDIS_PORT: 6379
REDIS_URL: redis://localhost:6379
GITHUB_CLIENT_ID: NO_GITHUB_CLIENT
GITHUB_CLIENT_SECRET: NO_GITHUB_SECRET
DATABASE_URL: postgres://postgres:postgres@localhost:5432/github_actions

jobs:
unit-tests:
name: Unit tests
runs-on: ubuntu-latest
env:
YARN_CACHE_DIR: ~/.yarn_cache

services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: github_actions
# Set health check to wait until postgres has started
options: >-
--health-cmd pg_isready --health-interval 10s --health-timeout 5s
--health-retries 5
ports:
- 5432:5432
redis:
image: redis
options: >-
--health-cmd "redis-cli ping" --health-interval 10s --health-timeout
5s --health-retries 10
ports:
- 6379:6379

steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Set up python 3.10
id: py
uses: actions/setup-python@v2
with:
python-version: '3.10'
cache: pip
cache-dependency-path: 'requirements/*.txt'

- name: Set up yarn cache
id: yarn-cache
uses: actions/cache@v3
with:
path: ${{ env.YARN_CACHE_DIR }}
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}

- name: Install Python dependencies
run: |
pip install -r requirements/prod.txt
pip install -r requirements/dev.txt
- name: Install Javascript dependencies
run: yarn install

- name: Run migrations
run: python manage.py migrate

- name: Check for migrations
run: python manage.py makemigrations --check --dry-run

- name: Run Pytest
run: pytest
4 changes: 4 additions & 0 deletions .slugignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.circleci
/.github
docker-compose.yml
env.example
3 changes: 3 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@
"mailgun:starter"
],
"buildpacks": [
{
"url": "heroku/nodejs"
},
{
"url": "https://github.com/SalesforceFoundation/simple-salesforce-dx-buildpack.git"
},
Expand Down
17 changes: 17 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "metaci",
"version": "0.1.0",
"private": true,
"license": "BSD-3-Clause",
"repository": {
"type": "git",
"url": "https://github.com/SFDO-Tooling/MetaCI.git"
},
"resolutions": {
"glob-parent": "5.1.2"
},
"engines": {
"node": "16.x",
"yarn": "1.x"
}
}

0 comments on commit 4555d70

Please sign in to comment.