Switch to using ruff, re: python project template #731
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Trigger ORNL GitLab Production Pipeline | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| branches: [next] | |
| tags: ['v*'] | |
| jobs: | |
| test-and-deploy: | |
| runs-on: ubuntu-22.04 | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - uses: conda-incubator/setup-miniconda@v2 | |
| name: Setup Conda | |
| with: | |
| auto-update-conda: true | |
| miniforge-version: latest | |
| environment-file: environment.yml | |
| - name: mypy type annotations | |
| run: mypy RefRed test scripts | |
| - name: dependencies synced | |
| run: python ./scripts/sync_dependencies.py | |
| - name: Run Tests | |
| run: xvfb-run -a python -m pytest -vv --cov=RefRed --cov-report=xml --cov-report=term test | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} # required | |
| trigger-deploy: | |
| runs-on: ubuntu-22.04 | |
| needs: [test-and-deploy] | |
| # only trigger deploys from protected branches and tags | |
| if: ${{ github.ref_protected || github.ref_type == 'tag' }} | |
| steps: | |
| - name: Determine Environment | |
| uses: neutrons/branch-mapper@v2 | |
| id: conda_env_name | |
| with: | |
| prefix: refred | |
| - name: Trigger deploy | |
| id: trigger | |
| uses: eic/trigger-gitlab-ci@v2 | |
| with: | |
| url: https://code.ornl.gov | |
| token: ${{ secrets.GITLAB_TRIGGER_TOKEN }} | |
| project_id: 7835 | |
| ref_name: main | |
| variables: | | |
| PLAY="update" | |
| CONDA_ENV="${{ steps.conda_env_name.outputs.name }}" | |
| - name: Annotate commit | |
| uses: peter-evans/commit-comment@v2 | |
| with: | |
| body: | | |
| GitLab pipeline for ${{ steps.conda_env_name.outputs.name }} has been submitted for this commit: ${{ steps.trigger.outputs.web_url }} |