|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + schedule: |
| 7 | + - cron: "0 0 * * 3" |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +jobs: |
| 11 | + resources: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - name: Checkout code |
| 15 | + uses: actions/checkout@v2 |
| 16 | + |
| 17 | + - name: Create resource cache |
| 18 | + id: cache |
| 19 | + uses: actions/cache@v3 |
| 20 | + with: |
| 21 | + path: ./fortran_tests/before/*/ |
| 22 | + key: resources-${{ github.event_name }} |
| 23 | + |
| 24 | + - name: Prepare tests (default) |
| 25 | + if: ${{ steps.cache.outputs.cache-hit != 'true' }} |
| 26 | + run: | |
| 27 | + .travis/prep_regular.sh |
| 28 | +
|
| 29 | + - name: Prepare tests (schedule) |
| 30 | + if: ${{ steps.cache.outputs.cache-hit != 'true' && github.event_name == 'schedule' }} |
| 31 | + run: | |
| 32 | + .travis/prep_cron.sh |
| 33 | +
|
| 34 | + conda: |
| 35 | + needs: |
| 36 | + - resources |
| 37 | + runs-on: ${{ matrix.os }} |
| 38 | + strategy: |
| 39 | + fail-fast: false |
| 40 | + matrix: |
| 41 | + os: [ubuntu-latest] |
| 42 | + python: ["3.7", "3.8", "3.9", "3.10"] |
| 43 | + |
| 44 | + defaults: |
| 45 | + run: |
| 46 | + shell: "bash -l {0}" |
| 47 | + |
| 48 | + steps: |
| 49 | + - name: Checkout code |
| 50 | + uses: actions/checkout@v2 |
| 51 | + |
| 52 | + - name: Load resources |
| 53 | + uses: actions/cache@v3 |
| 54 | + with: |
| 55 | + path: ./fortran_tests/before/*/ |
| 56 | + key: resources-${{ github.event_name }} |
| 57 | + |
| 58 | + - name: Install dependencies |
| 59 | + uses: mamba-org/provision-with-micromamba@main |
| 60 | + with: |
| 61 | + environment-file: environment.yml |
| 62 | + extra-specs: | |
| 63 | + python=${{ matrix.python }} |
| 64 | + coveralls |
| 65 | +
|
| 66 | + - name: Install project |
| 67 | + run: pip install . |
| 68 | + |
| 69 | + - name: Run tests |
| 70 | + run: | |
| 71 | + coverage run --source=fprettify setup.py test |
| 72 | +
|
| 73 | + - name: Coverage upload |
| 74 | + run: coveralls --service=github |
| 75 | + env: |
| 76 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 77 | + COVERALLS_FLAG_NAME: ${{ matrix.python }} |
| 78 | + COVERALLS_PARALLEL: true |
| 79 | + |
| 80 | + pip: |
| 81 | + needs: |
| 82 | + - resources |
| 83 | + runs-on: ${{ matrix.os }} |
| 84 | + strategy: |
| 85 | + fail-fast: false |
| 86 | + matrix: |
| 87 | + os: [ubuntu-latest] |
| 88 | + python: ["3.5", "3.6"] |
| 89 | + |
| 90 | + steps: |
| 91 | + - name: Checkout code |
| 92 | + uses: actions/checkout@v2 |
| 93 | + |
| 94 | + - name: Load resources |
| 95 | + uses: actions/cache@v3 |
| 96 | + with: |
| 97 | + path: ./fortran_tests/before/*/ |
| 98 | + key: resources-${{ github.event_name }} |
| 99 | + |
| 100 | + - uses: actions/setup-python@v3 |
| 101 | + with: |
| 102 | + python-version: ${{ matrix.python }} |
| 103 | + |
| 104 | + - name: Install dependencies |
| 105 | + run: pip install -r requirements.txt coveralls |
| 106 | + |
| 107 | + - name: Install project |
| 108 | + run: pip install . |
| 109 | + |
| 110 | + - name: Run tests |
| 111 | + run: | |
| 112 | + coverage run --source=fprettify setup.py test |
| 113 | +
|
| 114 | + - name: Coverage upload |
| 115 | + run: coveralls --service=github |
| 116 | + env: |
| 117 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 118 | + COVERALLS_FLAG_NAME: ${{ matrix.python }} |
| 119 | + COVERALLS_PARALLEL: true |
| 120 | + |
| 121 | + coverage: |
| 122 | + needs: |
| 123 | + - pip |
| 124 | + - conda |
| 125 | + runs-on: ubuntu-latest |
| 126 | + |
| 127 | + steps: |
| 128 | + - uses: actions/setup-python@v3 |
| 129 | + with: |
| 130 | + python-version: '3.x' |
| 131 | + |
| 132 | + - name: Install dependencies |
| 133 | + run: pip install coveralls |
| 134 | + |
| 135 | + - name: Coverage upload |
| 136 | + run: coveralls --service=github --finish |
| 137 | + env: |
| 138 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments