|
| 1 | +name: Python Package using Conda |
| 2 | + |
| 3 | +on: [push] |
| 4 | + |
| 5 | +jobs: |
| 6 | + build-linux: |
| 7 | + runs-on: ubuntu-latest |
| 8 | + strategy: |
| 9 | + max-parallel: 5 |
| 10 | + |
| 11 | + steps: |
| 12 | + - uses: actions/checkout@v3 |
| 13 | + - name: Set up Python 3.10 |
| 14 | + uses: actions/setup-python@v3 |
| 15 | + with: |
| 16 | + python-version: '3.10' |
| 17 | + - name: Add conda to system path |
| 18 | + run: | |
| 19 | + # $CONDA is an environment variable pointing to the root of the miniconda directory |
| 20 | + echo $CONDA/bin >> $GITHUB_PATH |
| 21 | + - name: Install dependencies |
| 22 | + run: | |
| 23 | + conda env update --file environment.yml --name base |
| 24 | + - name: Lint with flake8 |
| 25 | + run: | |
| 26 | + conda install flake8 |
| 27 | + # stop the build if there are Python syntax errors or undefined names |
| 28 | + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics |
| 29 | + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide |
| 30 | + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
| 31 | + - name: Test with pytest |
| 32 | + run: | |
| 33 | + conda install pytest |
| 34 | + pytest |
| 35 | + - name: Upload a Build Artifact |
| 36 | + uses: actions/upload-artifact@v4.3.1 |
| 37 | + with: |
| 38 | + # Artifact name |
| 39 | + name: # optional, default is artifact |
| 40 | + # A file, directory or wildcard pattern that describes what to upload |
| 41 | + path: |
| 42 | + # The desired behavior if no files are found using the provided path. |
| 43 | +Available Options: |
| 44 | + warn: Output a warning but do not fail the action |
| 45 | + error: Fail the action with an error message |
| 46 | + ignore: Do not output any warnings or errors, the action does not fail |
| 47 | + |
| 48 | + if-no-files-found: # optional, default is warn |
| 49 | + # Duration after which artifact will expire in days. 0 means using default retention. |
| 50 | +Minimum 1 day. Maximum 90 days unless changed from the repository settings page. |
| 51 | + |
| 52 | + retention-days: # optional |
| 53 | + # The level of compression for Zlib to be applied to the artifact archive. The value can range from 0 to 9: - 0: No compression - 1: Best speed - 6: Default compression (same as GNU Gzip) - 9: Best compression Higher levels will result in better compression, but will take longer to complete. For large files that are not easily compressed, a value of 0 is recommended for significantly faster uploads. |
| 54 | + |
| 55 | + compression-level: # optional, default is 6 |
| 56 | + # If true, an artifact with a matching name will be deleted before a new one is uploaded. If false, the action will fail if an artifact for the given name already exists. Does not fail if the artifact does not exist. |
| 57 | + |
| 58 | + overwrite: # optional, default is false |
| 59 | + |
0 commit comments