Skip to content

Commit

Permalink
Migrate CI and build tools (#78)
Browse files Browse the repository at this point in the history
* Migrate ci and build tools
  • Loading branch information
Superskyyy committed Apr 26, 2023
1 parent 8349b87 commit e0e9428
Show file tree
Hide file tree
Showing 13 changed files with 283 additions and 221 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: CI

on:
pull_request:
push:
branches:
- master
schedule:
- cron: '0 18 * * *'

concurrency:
group: CI-tests-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
changes:
# Check if any file related to Drain3/ CI behavior is changed
# set outputs for other jobs to access for if conditions
name: Check Changes
runs-on: ubuntu-latest
# To prevent error when there's no base branch
if: github.event_name != 'schedule'
timeout-minutes: 10
outputs:
drain3: ${{ steps.filter.outputs.drain3 }}
steps:
- uses: actions/checkout@v3 # required for push event
- name: Check for file changes
uses: getsentry/paths-filter@v2.11.1
id: filter
with:
token: ${{ github.token }}
# The following filters indicate a category along with
# the files that should not be ignored by CI when modified.
filters: |
drain3:
- '.github/**/*.yaml'
- '**/*.py'
- '**/Dockerfile*'
- '**/Makefile'
- 'tests/**'
- '**/*.bat'
- '**/*.sh'
- '**/*.ps1'
- '**/pyproject.toml'
- '**/poetry.lock'
- '**/*.cfg'
- '**/*.ini'
list-files: json # logs matched files
build:
runs-on: ubuntu-latest
needs: [changes]
if: |
( always() && ! cancelled() ) &&
((github.event_name == 'schedule' && github.repository == 'logpai/drain3') || needs.changes.outputs.drain3 == 'true')
strategy:
matrix:
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ]
fail-fast: false
env:
PYTHON_VERSION: ${{ matrix.python-version }}

steps:
- name: Check out Drain3 codebase
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Setup Poetry
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade poetry
- name: Install dependencies
run: poetry install

- name: Test with unittest
run: poetry run python -m unittest discover --verbose --start-directory tests
27 changes: 0 additions & 27 deletions .github/workflows/python_310.yaml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/python_36.yaml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/python_38.yaml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/python_39.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
**/__pycache__/*
MANIFEST
dist/*
venv/*
*venv/*
.idea/*
.vscode/*
drain3.egg-info/*
Expand Down
15 changes: 0 additions & 15 deletions Pipfile

This file was deleted.

53 changes: 0 additions & 53 deletions Pipfile.lock

This file was deleted.

Loading

0 comments on commit e0e9428

Please sign in to comment.