Skip to content

Commit

Permalink
Merge pull request #29 from nsidc/use-github-actions
Browse files Browse the repository at this point in the history
Use GitHub actions
  • Loading branch information
trey-stafford authored Oct 23, 2023
2 parents 8e433f0 + 5301e51 commit ee051ee
Show file tree
Hide file tree
Showing 13 changed files with 18,434 additions and 271 deletions.
82 changes: 0 additions & 82 deletions .circleci/config.yml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: build_and_release

on:
push:
tags:
- v*

# Default to bash in login mode; key to activating conda environment
# https://github.com/mamba-org/provision-with-micromamba#IMPORTANT
defaults:
run:
shell: "bash -l {0}"

jobs:
experimental_build:
name: "Run build"
runs-on: "ubuntu-latest"
steps:
- name: "Check out repository"
uses: "actions/checkout@v3"

- name: "Install Conda environment"
uses: "mamba-org/setup-micromamba@v1"
with:
environment-file: "conda-lock.yml"
# When using a lock-file, we have to set an environment name.
environment-name: "pm_icecon-ci"
cache-environment: true
# Increase this key to trigger cache invalidation
cache-environment-key: 1

- name: "Run conda build"
run: "conda build recipe/"

- name: "run anaconda upload"
env:
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
run: |
for ARTIFACT in $(ls /home/runner/micromamba/envs/pm_icecon-ci/conda-bld/noarch/*.tar.bz2) ; do
anaconda -t $ANACONDA_TOKEN upload -u nsidc -l main $ARTIFACT
done
38 changes: 38 additions & 0 deletions .github/workflows/experimental-build-on-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This workflow runs an experimental build for this package using `boa` to
# enable the use of the `mamba` solver in conda-build. `boa` is under
# development, so this is just to quickly test that the build works on pushes to
# `main`. When we publish the package, we will use a separate workflow for
# building it with `conda-build`.
name: experimental_build

on:
push:
branches:
- main

# Default to bash in login mode; key to activating conda environment
# https://github.com/mamba-org/provision-with-micromamba#IMPORTANT
defaults:
run:
shell: "bash -l {0}"

jobs:
experimental_build:
name: "Run experimental build with boa"
runs-on: "ubuntu-latest"
steps:
- name: "Check out repository"
uses: "actions/checkout@v3"

- name: "Install Conda environment"
uses: "mamba-org/setup-micromamba@v1"
with:
environment-file: "conda-lock.yml"
# When using a lock-file, we have to set an environment name.
environment-name: "pm_icecon-ci"
cache-environment: true
# Increase this key to trigger cache invalidation
cache-environment-key: 1

- name: "run experimental build"
run: "conda mambabuild recipe/"
39 changes: 39 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on:
pull_request:
push:
branches:
- main

# Default to bash in login mode; key to activating conda environment
# https://github.com/mamba-org/provision-with-micromamba#IMPORTANT
defaults:
run:
shell: "bash -l {0}"

jobs:
test:
name: "Run tests"
runs-on: "ubuntu-latest"
steps:
- name: "Check out repository"
uses: "actions/checkout@v3"

- name: "Install Conda environment"
uses: "mamba-org/setup-micromamba@v1"
with:
environment-file: "conda-lock.yml"
# When using a lock-file, we have to set an environment name.
environment-name: "pm_icecon-ci"
cache-environment: true
# Increase this key to trigger cache invalidation
cache-environment-key: 1

# Linter
- name: "Run pre-commit tests"
run: "pre-commit run --all-files"

# Run mypy and unit tests Unit tests
- name: "Run unit tests"
run: "invoke test.ci"
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ repos:
rev: "v4.4.0"
hooks:
- id: "check-added-large-files"
args: ['--maxkb=1000']
- id: "check-vcs-permalinks"
- id: "end-of-file-fixer"

Expand Down
31 changes: 2 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,36 +115,9 @@ that expect access to NSIDC's virtual machine infrastructure and should be used
with caution.


### Misc. Development notes
## Development/contributing

This project uses `invoke` as a task runner. To see all of the available tasks:

```
$ invoke -l
Available tasks:
format.format (format) Apply formatting standards to the codebase.
test.all (test) Run all of the tests.
test.ci Run tests in CircleCI.
test.lint (test.flake8) Run flake8 linting.
test.regression Run regression tests.
test.typecheck (test.mypy) Run mypy typechecking.
test.unit Run unit tests.
test.vulture Use `vulture` to detect dead code.
```


## Making a new release

To make a new release:

1. Make a feature branch and commit your changes.
2. Update the CHANGELOG.md and bump the version (`bumpversion {major|minor|patch}`)
3. Open a PR and have it reviewed.
4. If tests pass and the PR has been approved, merge with `main`.
5. Tag the last commit in `main` with the version you bumped to. This will
automatically trigger a circleCI build that includes deployment of the
pacakge to anaconda.org.
See [doc/development.md](doc/development.md) for more information.


## License
Expand Down
Loading

0 comments on commit ee051ee

Please sign in to comment.