forked from eladyaniv01/SC2MapAnalysis
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from spudde123/develop
feat: poetry project, updated build file and new CI workflow
- Loading branch information
Showing
57 changed files
with
3,476 additions
and
724 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# .flake8 | ||
[flake8] | ||
max-line-length = 88 | ||
extend-ignore = E203, F631 | ||
per-file-ignores = | ||
*/__init__.py: F401 | ||
exclude = | ||
tests/test_docs.py | ||
run.py # should be removed? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: BuildCExtension | ||
on: | ||
push: | ||
branches: [ master, develop ] | ||
|
||
jobs: | ||
build: | ||
name: Build release | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# TODO: Get this working on ubuntu-latest. Refuses to build, and no idea why | ||
os: [windows-latest, macos-latest] | ||
python-version: ['3.11'] | ||
|
||
steps: | ||
# check-out repo | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
# install poetry | ||
- name: Install poetry | ||
run: pipx install poetry==1.5 | ||
# set-up python with cache | ||
- name: Setup Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: 'poetry' | ||
# Install requirements and build extension | ||
- name: Install requirements and build extension | ||
run: | | ||
poetry install --with dev | ||
python -c "import shutil, glob, os; [shutil.copy(f, '.') for f in glob.glob('mapanalyzerext*') if not os.path.exists(os.path.join('.', os.path.basename(f)))]" | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ matrix.os }}_python${{ matrix.python-version }} | ||
path: | | ||
./mapanalyzerext* | ||
mapanalyzerext* |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Linting | ||
|
||
on: | ||
pull_request: | ||
branches: [ master, develop ] | ||
workflow_call: | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest ] | ||
python-version: [ 3.11 ] | ||
|
||
steps: | ||
# check-out repo | ||
- uses: actions/checkout@v2 | ||
- name: Set up ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
pipx install poetry==1.6.1 | ||
poetry install --with dev | ||
# run linters | ||
- name: Run linters | ||
run: | | ||
set -o pipefail | ||
poetry run make lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Orchestrator | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
call-testing-pipeline: | ||
name: Testing | ||
uses: ./.github/workflows/tests.yml | ||
call-linting-pipeline: | ||
name: Linting | ||
uses: ./.github/workflows/lint.yml | ||
call-release-pipeline: | ||
name: Release | ||
needs: | ||
- call-testing-pipeline | ||
- call-linting-pipeline | ||
uses: ./.github/workflows/release.yml | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
concurrency: release | ||
|
||
steps: | ||
# check-out repo | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
# install poetry | ||
- name: Install poetry | ||
run: pipx install poetry==1.6.1 | ||
# set-up python with cache | ||
- name: Setup Python 3.11 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
cache: 'poetry' | ||
# install requirements | ||
- name: Install requirements | ||
run: poetry install --only semver | ||
# semantic release | ||
- name: Python Semantic Release | ||
env: | ||
GH_TOKEN: ${{ secrets.GH_TOKEN_MA }} | ||
run: | | ||
set -o pipefail | ||
# Set git details | ||
git config --global user.name "github-actions" | ||
git config --global user.email "github-actions@github.com" | ||
# run semantic-release | ||
poetry run semantic-release publish -v DEBUG -D commit_author="github-actions <action@github.com>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: "Lint PR" | ||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
jobs: | ||
main: | ||
name: Validate PR title | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: amannn/action-semantic-pull-request@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: RunTests | ||
|
||
on: | ||
pull_request: | ||
branches: [ master, develop ] | ||
workflow_call: | ||
|
||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
python-version: [3.11] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
pipx install poetry==1.6.1 | ||
poetry install --with dev | ||
- name: Test with pytest + Coverage | ||
run: | | ||
poetry run pytest --html=html/${{ matrix.os }}-test-results-${{ matrix.python-version }}.html | ||
- name: Upload pytest test results | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }} | ||
path: html/${{ matrix.os }}-test-results-${{ matrix.python-version }}.html | ||
# Use always() to always run this step to publish test results when there are test failures | ||
if: ${{ always() }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
format-black: | ||
@black . | ||
format-isort: | ||
@isort . | ||
lint-black: | ||
@black . --check | ||
lint-isort: | ||
@isort . --check | ||
lint-flake8: | ||
@flake8 . | ||
|
||
lint: lint-black lint-isort lint-flake8 | ||
|
||
current-version: | ||
@semantic-release print-version --current | ||
|
||
next-version: | ||
@semantic-release print-version --next | ||
|
||
current-changelog: | ||
@semantic-release changelog --released | ||
|
||
next-changelog: | ||
@semantic-release changelog --unreleased | ||
|
||
publish-noop: | ||
@semantic-release publish --noop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.