|
8 | 8 | - created |
9 | 9 |
|
10 | 10 | jobs: |
11 | | - standard: |
| 11 | + pre_commit: |
12 | 12 | uses: pcdshub/pcds-ci-helpers/.github/workflows/pre-commit.yml@master |
13 | 13 | with: |
14 | 14 | args: "--all-files" |
| 15 | + |
| 16 | + test: |
| 17 | + name: "Python 3.12: pip" |
| 18 | + runs-on: ubuntu-latest |
| 19 | + |
| 20 | + defaults: |
| 21 | + run: |
| 22 | + # The following allows for each run step to utilize ~/.bash_profile |
| 23 | + # for setting up the per-step initial state. |
| 24 | + # --login: a login shell. Source ~/.bash_profile |
| 25 | + # -e: exit on first error |
| 26 | + # -o pipefail: piped processes are important; fail if they fail |
| 27 | + shell: bash --login -eo pipefail {0} |
| 28 | + |
| 29 | + steps: |
| 30 | + - uses: actions/checkout@v4 |
| 31 | + with: |
| 32 | + fetch-depth: 0 |
| 33 | + submodules: 'recursive' |
| 34 | + |
| 35 | + - name: Check version to be built |
| 36 | + run: | |
| 37 | + # NOTE: If you run CI on your own fork, you may not have the right version |
| 38 | + # number for the package. Synchronize your tags with the upstream, |
| 39 | + # otherwise cross-dependencies may result in confusing build failure. |
| 40 | + (echo "Package version: $(git describe --tags)" | tee "$GITHUB_STEP_SUMMARY") || \ |
| 41 | + echo "::warning::Git tags not found in repository. Build may fail!" |
| 42 | +
|
| 43 | + - name: Check environment variables for issues |
| 44 | + run: | |
| 45 | + echo "* Package to be built: pre-commit" |
| 46 | +
|
| 47 | + - name: Prepare for log files |
| 48 | + run: | |
| 49 | + mkdir $HOME/logs |
| 50 | +
|
| 51 | + - uses: actions/setup-python@v5 |
| 52 | + with: |
| 53 | + python-version: "3.12" |
| 54 | + |
| 55 | + - name: Upgrade pip |
| 56 | + run: | |
| 57 | + pip install --upgrade pip |
| 58 | +
|
| 59 | + - name: Install package |
| 60 | + run: | |
| 61 | + python -m pip install . |
| 62 | +
|
| 63 | + - name: Check the pip packages in the test env |
| 64 | + run: | |
| 65 | + pip list |
| 66 | +
|
| 67 | + - name: Run tests |
| 68 | + run: | |
| 69 | + pytest -v \ |
| 70 | + --log-file="$HOME/logs/debug_log.txt" \ |
| 71 | + --log-format='%(asctime)s.%(msecs)03d %(module)-15s %(levelname)-8s %(threadName)-10s %(message)s' \ |
| 72 | + --log-file-date-format='%H:%M:%S' \ |
| 73 | + --log-level=DEBUG \ |
| 74 | + 2>&1 | tee "$HOME/logs/pytest_log.txt" |
0 commit comments