Skip to content

Commit

Permalink
Merge pull request #781 from PCMDI/776_ljw_workflow
Browse files Browse the repository at this point in the history
Remove ymal files to start from scratch
  • Loading branch information
lee1043 authored Nov 1, 2021
2 parents 8993d51 + 7515a83 commit 2f58e4b
Show file tree
Hide file tree
Showing 17 changed files with 82 additions and 1,426 deletions.
161 changes: 0 additions & 161 deletions .circleci/config.yml

This file was deleted.

82 changes: 82 additions & 0 deletions .github/workflows/build_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: CI/CD Build Workflow

on:
push:
branches: [master]

pull_request:
branches: [master]

workflow_dispatch:

jobs:
check-jobs-to-skip:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@master
with:
cancel_others: true
paths_ignore: '["**/README.rst", "**/docs/**", "**/ISSUE_TEMPLATE/**", "**/pull_request_template.md", "**/.vscode/**"]'

pre-commit-hooks:
needs: check-jobs-to-skip
if: ${{ needs.check-jobs-to-skip.outputs.should_skip != 'true'}} || ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- name: Checkout Code Repository
uses: actions/checkout@v2

- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9

# Run all pre-commit hooks on all the files.
# Getting only staged files can be tricky in case a new PR is opened
# since the action is run on a branch in detached head state
- name: Install and Run Pre-commit
uses: pre-commit/action@v2.0.3

build:
needs: check-jobs-to-skip
if: ${{ needs.check-jobs-to-skip.outputs.should_skip != 'true'}} || ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
timeout-minutes: 5
steps:
- uses: actions/checkout@v2

- name: Cache Conda
uses: actions/cache@v2
env:
# Increase this value to reset cache if conda/dev.yml has not changed in the workflow
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-publish

- name: Set up Conda Environment
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: "xcdat_dev"
environment-file: conda-env/dev.yml
channel-priority: strict
auto-update-conda: true
# IMPORTANT: This needs to be set for caching to work properly!
use-only-tar-bz2: true

- name: Run Tests
run: |
pytest
- name: Upload Coverage Report
uses: codecov/codecov-action@v1
with:
file: "tests_coverage_reports/coverage.xml"
fail_ci_if_error: true
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,4 @@ ENV/
# Rope project settings
.ropeproject

# durack1 files
recipes/conda-envs/pmp-1.1.2a.yml
test/
124 changes: 0 additions & 124 deletions Makefile

This file was deleted.

Loading

0 comments on commit 2f58e4b

Please sign in to comment.