-
Notifications
You must be signed in to change notification settings - Fork 19
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 #13 from Nekotoxin/migrate_to_github_action
fix: Migrate to GitHub action
- Loading branch information
Showing
18 changed files
with
248 additions
and
132 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,3 @@ | ||
[run] | ||
include = casbin_adapter/* | ||
omit = *migrations*, *tests* |
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,2 @@ | ||
# Always validate the PR title AND all the commits | ||
titleAndCommits: true |
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,104 @@ | ||
name: build | ||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ['3.7', '3.8', '3.9', '3.10'] | ||
os: [ubuntu-18.04, macOS-latest, windows-latest] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install -r requirements_dev.txt | ||
pip install coveralls | ||
pip install pytest | ||
- name: Run tests | ||
run: coverage run -m django test --settings=tests.settings | ||
|
||
- name: Upload coverage data to coveralls.io | ||
run: coveralls --service=github | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
COVERALLS_FLAG_NAME: ${{ matrix.os }} - ${{ matrix.python-version }} | ||
COVERALLS_PARALLEL: true | ||
|
||
lint: | ||
name: Run Linters | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Super-Linter | ||
uses: github/super-linter@v4.9.2 | ||
env: | ||
VALIDATE_ALL_CODEBASE: false | ||
VALIDATE_PYTHON_BLACK: true | ||
DEFAULT_BRANCH: master | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
LINTER_RULES_PATH: / | ||
PYTHON_BLACK_CONFIG_FILE: pyproject.toml | ||
|
||
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 }} | ||
|
||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
needs: [ test, coveralls ] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '16' | ||
|
||
- name: Setup | ||
run: npm install -g semantic-release @semantic-release/github @semantic-release/changelog @semantic-release/commit-analyzer @semantic-release/git @semantic-release/release-notes-generator semantic-release-pypi | ||
|
||
- name: Set up python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install setuptools | ||
run: python -m pip install --upgrade setuptools wheel twine | ||
|
||
- name: Release | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
run: npx semantic-release |
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,23 @@ | ||
{ | ||
"branches": "master", | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
"semantic-release-pypi", | ||
"@semantic-release/github", | ||
[ | ||
"@semantic-release/changelog", | ||
{ | ||
"changelogFile": "CHANGELOG.md", | ||
"changelogTitle": "# Semantic Versioning Changelog" | ||
} | ||
], | ||
[ | ||
"@semantic-release/git", | ||
{ | ||
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}", | ||
"assets": ["CHANGELOG.md", "setup.py", "setup.cfg"] | ||
} | ||
] | ||
] | ||
} |
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
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
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
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
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
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
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,2 @@ | ||
[tool.black] | ||
line-length = 120 |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
casbin | ||
django | ||
casbin==1.16.10 | ||
Django | ||
|
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,3 @@ | ||
-r requirements.txt | ||
setuptools==60.2.0 | ||
simpleeval==0.9.12 |
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,2 @@ | ||
[metadata] | ||
version = 1.0.0 |
Oops, something went wrong.