Skip to content

Commit

Permalink
Merge pull request #238 from ninoseki/simplify-ci
Browse files Browse the repository at this point in the history
ci: simplify workflows
  • Loading branch information
ninoseki authored Jul 7, 2024
2 parents 36a33a1 + 0a3f9f7 commit ecb04f6
Show file tree
Hide file tree
Showing 4 changed files with 207 additions and 228 deletions.
17 changes: 6 additions & 11 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,21 @@ on:
- "frontend/**"
- ".github/workflows/node.yml"

env:
NODE_VERSION: 20

jobs:
test:
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 }}
node-version: ${{ env.NODE_VERSION }}
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Install npm dependencies
Expand All @@ -39,21 +38,17 @@ jobs:
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 }}
node-version: ${{ env.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: NODE_ENV=production npx eslint
run: NODE_ENV=production npm run lint
36 changes: 10 additions & 26 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ on:
- "requirements.txt"
- "tests/**"

env:
PYTHON_VERSION: 3.11
POETRY_VERSION: 1.8.3

jobs:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11]
poetry-version: [1.8.1]
steps:
- uses: actions/checkout@v4
- name: Setup poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: ${{ matrix.poetry-version }}
poetry-version: ${{ env.POETRY_VERSION }}
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ env.PYTHON_VERSION }}
cache: "poetry"
- name: Install dependencies
run: poetry install
Expand All @@ -50,19 +50,15 @@ jobs:
image: instantlinux/spamassassin:4.0.0-6
ports:
- 783:783
strategy:
matrix:
python-version: [3.11]
poetry-version: [1.8.1]
steps:
- uses: actions/checkout@v4
- name: Setup poetry
uses: abatilo/actions-poetry@v3
with:
poetry-version: ${{ matrix.poetry-version }}
poetry-version: ${{ env.POETRY_VERSION }}
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ env.PYTHON_VERSION }}
cache: "poetry"
- name: Install dependencies
run: poetry install
Expand All @@ -71,20 +67,8 @@ jobs:
- name: Wait until SpamAssasin ready
run: poetry run python scripts/ping.py
- name: Run tests
run: poetry run pytest -v --cov=app --cov-report=term-missing
run: poetry run coverage run -m pytest
- 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 }}
run: poetry run coveralls
Loading

0 comments on commit ecb04f6

Please sign in to comment.