diff --git a/.github/workflows/auto_apply_version_metadata.yml b/.github/workflows/auto_apply_version_metadata.yml deleted file mode 100644 index 268c38a..0000000 --- a/.github/workflows/auto_apply_version_metadata.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Apply Version Metadata - -on: - pull_request: - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.10"] - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - name: Auto Apply Version Metadata - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: Apply version metadata - run: | - python test/auto_apply_version_metadata.py diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml new file mode 100644 index 0000000..fc088f6 --- /dev/null +++ b/.github/workflows/checks.yml @@ -0,0 +1,41 @@ +name: Apply PEP8, Metadata, and Run Tests + +on: + pull_request_target: + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.10"] + steps: + - uses: actions/checkout@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + ref: ${{ github.head_ref }} + fetch-depth: 0 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install Dependencies + run: | + python -m pip install --upgrade pip + pip install autopep8 + pip install -r test/pip_reqs.txt + - name: Apply PEP8 + run: | + autopep8 --in-place --recursive . + - name: Apply Version Metadata + run: | + python test/auto_apply_version_metadata.py $(git log --pretty=format:'%h' -n 1) + - name: Apply Commit + uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: "[ci] auto-format" + branch: ${{ github.head_ref }} + - name: Execute Tests + run: | + python -m unittest discover -v diff --git a/.github/workflows/code_style.yml b/.github/workflows/code_style.yml deleted file mode 100644 index d68a906..0000000 --- a/.github/workflows/code_style.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Code Style - -on: - push: - pull_request: - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.10"] - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install flake8 - - name: Execute Flake8 - run: | - flake8 $(git ls-files '*.py') diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index d96fffa..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Tests - -on: - push: - pull_request: - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.10"] - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - - name: Install Dependencies - run: | - python -m pip install --upgrade pip - pip install -r test/pip_reqs.txt - - name: Execute Tests - run: | - python -m unittest discover -v