Skip to content
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

[ITG-79] Setup CI #15

Merged
merged 2 commits into from
Apr 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/bode_ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: "Bode CI"

on:
pull_request:
paths:
- "bode/**"
push:
paths:
- "bode/**"
Comment on lines +7 to +9
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think every push means also running after pushing from local -- it may be doubled and unnecessary. Wdyt?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this way you can see if CI is passing without creating a PR, the feedback loop is a bit shorter. I think we can leave it like that, merge, observe if we have redundant workflow runs and then adjust accordingly if needed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok


jobs:
ci:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./bode

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.10.4"
- uses: abatilo/actions-poetry@v2.0.0
with:
poetry-version: "1.1.13"

- name: Cache venv
id: cache-venv
uses: actions/cache@v2
env:
cache-name: cache-venv
with:
path: .venv
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-

- run: poetry config virtualenvs.in-project true

- name: Install dependencies
run: poetry install

- name: Check formatting
run: poetry run black bode migrations --check --verbose

- name: Lint
run: poetry run flake8 bode migrations --verbose

- name: Check sorting
run: poetry run isort bode migrations --check
48 changes: 48 additions & 0 deletions .github/workflows/cabra_ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: "Cabra CI"

on:
pull_request:
paths:
- "cabra/**"
push:
paths:
- "cabra/**"

jobs:
ci:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./cabra

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "16.14.2"

- name: Cache node modules
id: cache-nodemodules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-

- name: Install Dependencies
if: steps.cache-nodemodules.outputs.cache-hit != 'true'
run: npm ci

- name: Check formatting
run: npm run format:check

- name: Check types
run: npm run types:check

- name: Lint
run: npm run lint:check