-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5447e05
commit 73074a2
Showing
4 changed files
with
87 additions
and
175 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 |
---|---|---|
|
@@ -2,76 +2,36 @@ name: CI | |
|
||
on: | ||
push: | ||
branches: [ master, release ] | ||
branches: [master, release] | ||
pull_request: | ||
branches: [ master ] | ||
pull_request_target: | ||
branches: [master] | ||
release: | ||
types: [ published ] | ||
|
||
types: [published] | ||
|
||
jobs: | ||
|
||
test: | ||
if: | | ||
(github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]') || | ||
(github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]') | ||
name: Run tests | ||
strategy: | ||
matrix: | ||
python-version: ['3.8', '3.9', '3.10'] | ||
os: [ubuntu, macos, windows] | ||
fail-fast: false | ||
runs-on: ${{ matrix.os }}-latest | ||
env: | ||
PYTHONIOENCODING: utf-8 | ||
name: All checks are passed | ||
uses: ./.github/workflows/test.yaml | ||
|
||
approve: | ||
name: Approve bot PR | ||
runs-on: ubuntu-latest | ||
if: endsWith(github.actor, '[bot]') | ||
needs: test | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
steps: | ||
- name: Checkout commit | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Install python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: metadata | ||
id: metadata | ||
if: github.actor == 'dependabot[bot]' | ||
uses: dependabot/fetch-metadata@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Cache Python and its deps | ||
uses: actions/cache@v3 | ||
with: | ||
key: ${{ runner.os }}-python-${{ matrix.python-version }}-${{ hashFiles('requirements/*.txt') }} | ||
path: ${{ env.pythonLocation }} | ||
|
||
- name: Install GNU libraries for MacOS | ||
if: matrix.os == 'macos' | ||
shell: bash | ||
run: | | ||
HOMEBREW_NO_AUTO_UPDATE=1 brew install findutils | ||
echo PATH="/usr/local/opt/findutils/libexec/gnubin:$PATH" >> $GITHUB_ENV | ||
- name: Install python dependencies | ||
run: | | ||
make setup | ||
- name: Configure environment | ||
run: | | ||
neuro config login-with-token ${{ secrets.CLIENT_TEST_E2E_USER_NAME }} https://dev.neu.ro/api/v1 | ||
neuro --color=no config show | ||
- uses: webfactory/[email protected] | ||
# Authenticates ssh on worker to pull repos under github.com/neuro-actions via ssh | ||
# Y.S. key is used | ||
with: | ||
ssh-private-key: ${{ secrets.GH_NF_ACTIONS_SSH_PRIVATE }} | ||
log-public-key: false | ||
|
||
- name: Lint | ||
run: | | ||
make lint | ||
- name: Run tests | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Enable auto-merge for bot PRs | ||
run: gh pr merge --auto --squash --delete-branch "$PR_URL" | ||
env: | ||
NEURO_USER: ${{ secrets.CLIENT_TEST_E2E_USER_NAME }} | ||
run: | | ||
make test | ||
PR_URL: ${{ github.event.pull_request.html_url }} | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.
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,63 @@ | ||
on: | ||
workflow_call: {} | ||
|
||
jobs: | ||
test: | ||
name: Run tests | ||
strategy: | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10"] | ||
os: [ubuntu, macos, windows] | ||
fail-fast: false | ||
runs-on: ${{ matrix.os }}-latest | ||
env: | ||
PYTHONIOENCODING: utf-8 | ||
steps: | ||
- name: Checkout commit | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Install python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Cache Python and its deps | ||
uses: actions/cache@v3 | ||
with: | ||
key: ${{ runner.os }}-python-${{ matrix.python-version }}-${{ hashFiles('requirements/*.txt') }} | ||
path: ${{ env.pythonLocation }} | ||
|
||
- name: Install GNU libraries for MacOS | ||
if: matrix.os == 'macos' | ||
shell: bash | ||
run: | | ||
HOMEBREW_NO_AUTO_UPDATE=1 brew install findutils | ||
echo PATH="/usr/local/opt/findutils/libexec/gnubin:$PATH" >> $GITHUB_ENV | ||
- name: Install python dependencies | ||
run: | | ||
make setup | ||
- name: Configure environment | ||
run: | | ||
neuro config login-with-token ${{ secrets.CLIENT_TEST_E2E_USER_NAME }} https://dev.neu.ro/api/v1 | ||
neuro --color=no config show | ||
- uses: webfactory/[email protected] | ||
# Authenticates ssh on worker to pull repos under github.com/neuro-actions via ssh | ||
# Y.S. key is used | ||
with: | ||
ssh-private-key: ${{ secrets.GH_NF_ACTIONS_SSH_PRIVATE }} | ||
log-public-key: false | ||
|
||
- name: Lint | ||
run: | | ||
make lint | ||
- name: Run tests | ||
env: | ||
NEURO_USER: ${{ secrets.CLIENT_TEST_E2E_USER_NAME }} | ||
run: | | ||
make test |