|
| 1 | +name: mplfinance Checks |
| 2 | +on: [ push, pull_request ] |
| 3 | +jobs: |
| 4 | + Regression_Tests: |
| 5 | + runs-on: ubuntu-latest |
| 6 | + strategy: |
| 7 | + matrix: |
| 8 | + python-version: [3.6, 3.7, 3.8, 3.9] |
| 9 | + steps: |
| 10 | + - name: Preliminary Information |
| 11 | + run: | |
| 12 | + echo "The job was automatically triggered by a ${{ github.event_name }} event." |
| 13 | + echo "This job is now running on a ${{ runner.os }} server hosted by GitHub!" |
| 14 | + echo "The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." |
| 15 | + echo " " |
| 16 | + echo "github.ref = ${{ github.ref }}" |
| 17 | + echo "github.sha = ${{ github.sha }}" |
| 18 | + echo "github.event.pull_request.head.ref = ${{ github.event.pull_request.head.ref }}" |
| 19 | + echo "github.event.pull_request.head.sha = ${{ github.event.pull_request.head.sha }}" |
| 20 | + echo "github.event.pull_request.base.ref = ${{ github.event.pull_request.base.ref }}" |
| 21 | + echo "github.event.pull_request.base.sha = ${{ github.event.pull_request.base.sha }}" |
| 22 | + echo " " |
| 23 | +
|
| 24 | + - name: Check out repository code |
| 25 | + uses: actions/checkout@v2 |
| 26 | + |
| 27 | + - run: echo "The ${{ github.repository }} repository has been cloned to the runner." |
| 28 | + |
| 29 | + - name: Set up Python ${{ matrix.python-version }} |
| 30 | + uses: actions/setup-python@v2 |
| 31 | + with: |
| 32 | + python-version: ${{ matrix.python-version }} |
| 33 | + |
| 34 | + - name: Install dependencies |
| 35 | + run: | |
| 36 | + python -m pip install --upgrade pip |
| 37 | + pip install pytest |
| 38 | + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi |
| 39 | +
|
| 40 | + - name: Install My Package |
| 41 | + run: pip install . |
| 42 | + |
| 43 | + - name: Run Pytest |
| 44 | + run: python -m pytest |
| 45 | + |
| 46 | + - run: echo "This job's status is ${{ job.status }}." |
| 47 | + |
| 48 | + Pull_Request_Updates_Version: |
| 49 | + runs-on: ubuntu-latest |
| 50 | + if: github.event_name == 'pull_request' |
| 51 | + steps: |
| 52 | + - name: Check out repository code |
| 53 | + uses: actions/checkout@v2 |
| 54 | + |
| 55 | + - name: Set up Python ${{ matrix.python-version }} |
| 56 | + uses: actions/setup-python@v2 |
| 57 | + with: |
| 58 | + python-version: '3.10' |
| 59 | + |
| 60 | + - name: Install dependencies |
| 61 | + run: | |
| 62 | + python -m pip install --upgrade pip |
| 63 | + pip install packaging |
| 64 | +
|
| 65 | + - name: Fetch base and head on PR |
| 66 | + if: ${{ github.event.pull_request.base.sha }} |
| 67 | + run: | |
| 68 | + git fetch origin master ${{ github.event.pull_request.base.sha }} |
| 69 | + git fetch origin master ${{ github.event.pull_request.head.sha }} |
| 70 | +
|
| 71 | + - name: Check that Pull Request includes updating the Version |
| 72 | + run: | |
| 73 | + git show ${{ github.event.pull_request.base.sha }}:src/mplfinance/_version.py > scripts/tv0.py |
| 74 | + git show ${{ github.sha }}:src/mplfinance/_version.py > scripts/tv1.py |
| 75 | + python scripts/version_update_check.py tv0 tv1 |
| 76 | +
|
0 commit comments