chinese-holidays-calendar/.github/workflows/ci.yml
Muhan Li 4776475589 Add Ontario holiday
testing ip
2024-10-18 20:54:37 -04:00

129 lines
2.7 KiB
YAML

name: Continuous Integration
on:
push:
branches:
- "**"
pull_request:
branches:
- "**"
jobs:
crawler:
name: Crawler Dry Run
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13-dev"]
steps:
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run crawler script
shell: bash
run: python crawler.py
- name: Run global scripts
shell: bash
run: |
for script in global/*/main.py; do
cd $(dirname $script)
python $(basename $script)
done
parser:
name: Parser Dry Run
runs-on: ubuntu-latest
strategy:
matrix:
ghc: ["9.6", "9.8"]
cabal: ["3.10", "latest"]
include:
- ghc: "9.2.8"
cabal: "3.10.1.0"
steps:
- uses: actions/checkout@v4
- name: Setup Haskell ${{ matrix.ghc }} with Cabal ${{ matrix.cabal }}
uses: haskell-actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Configure the build
run: |
cabal configure --enable-tests --enable-benchmarks --disable-documentation
cabal build --dry-run
- name: Build
run: cabal build all
- name: Run tests
run: cabal test all
- name: Check cabal file
run: cabal check
- name: Run parser
run: cabal run
- name: Checkout files
run: |
pwd
ls -la
ls -la docs
hlint:
name: HLint
runs-on: ubuntu-latest
defaults:
run:
working-directory: .
steps:
- uses: actions/checkout@v4
- name: "Set up HLint"
uses: haskell-actions/hlint-setup@v2
- name: "Run HLint"
uses: haskell-actions/hlint-run@v2
with:
path: parser/
fail-on: warning
pylint:
name: Pylint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python Environment
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Analyzing the code with pylint
run: |
pylint $(git ls-files '*.py')