Skip to content

Commit

Permalink
ci: renew CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ninoseki committed Feb 3, 2024
1 parent f017e11 commit 1791477
Show file tree
Hide file tree
Showing 3 changed files with 124 additions and 47 deletions.
46 changes: 41 additions & 5 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,59 @@
name: Node.js CI
on: ["pull_request", "push"]

on:
push:
branches: [master]
paths:
- "frontend/**"
- ".github/workflows/node.yml"
pull_request:
branches: [master]
paths:
- "frontend/**"
- ".github/workflows/node.yml"

jobs:
build:
test:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend
strategy:
matrix:
node-version: [20]
node-version:
- 20
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Install npm dependencies
run: npm install
- name: Run tests
run: npm run test:unit
lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend
strategy:
matrix:
node-version:
- 20
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Install npm dependencies
run: npm install
- name: Run type-check
run: npm run type-check
- name: Run ESLint
run: npx eslint
83 changes: 83 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Python CI

on:
push:
branches: [master]
paths:
- ".github/workflows/python.yml"
- "backend/**"
- "poetry.lock"
- "pyproject.toml"
- "requirements.txt"
- "tests/**"
pull_request:
branches: [master]
paths:
- ".github/workflows/python.yml"
- "backend/**"
- "poetry.lock"
- "pyproject.toml"
- "requirements.txt"
- "tests/**"

jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11]
poetry-version: [1.7.1]
steps:
- uses: actions/checkout@v4
- name: Setup poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: ${{ matrix.poetry-version }}
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Install dependencies
run: poetry install
- name: Ruff check
run: poetry run ruff check backend/ tests/
- name: Pyupgrade
run: poetry run pyupgrade backend/ tests/
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11]
poetry-version: [1.7.1]
steps:
- uses: actions/checkout@v4
- name: Setup poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: ${{ matrix.poetry-version }}
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Install dependencies
run: poetry install
- name: Make dummy frontend directory
run: mkdir -p frontend/dist/
- name: Run tests
run: poetry run pytest -v --cov=app --cov-report=term-missing
- name: Coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: poetry run coveralls --service=github
coveralls:
name: Indicate completion to coveralls.io
needs: test
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Finished
run: |
pip3 install --upgrade coveralls
coveralls --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42 changes: 0 additions & 42 deletions .github/workflows/test.yml

This file was deleted.

0 comments on commit 1791477

Please sign in to comment.