Merge pull request #188 from ecmwf-projects/dependabot/github_actions… #288
This file contains 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: on-push | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
pull_request: | |
branches: | |
- main | |
concurrency: | |
group: ${{ '{{ github.workflow }}' }}-${{ '{{ github.ref }}' }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash -l {0} | |
jobs: | |
pre-commit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.x | |
- uses: pre-commit/[email protected] | |
test-package: | |
runs-on: ubuntu-latest | |
needs: [pre-commit] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.x | |
- name: Install cruft | |
run: pip3 install cruft | |
- name: Create my-package | |
run: cruft create . --output-dir .. -y | |
- name: Install Conda environment with Micromamba | |
uses: mamba-org/setup-micromamba@v2 | |
with: | |
environment-file: ../my-package/ci/environment-ci.yml | |
environment-name: DEVELOP | |
cache-environment: true | |
create-args: >- | |
python=3.11 | |
- name: Test my-package | |
run: | | |
cd ../my-package || exit | |
git init || exit | |
git add . || exit | |
pip install -e . || exit | |
make || exit | |
make docs-build || exit |