Skip to content

Commit

Permalink
finish up initial draft for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
lizgehret committed Jul 24, 2024
1 parent 1894981 commit 4598530
Showing 1 changed file with 22 additions and 90 deletions.
112 changes: 22 additions & 90 deletions .github/workflows/lib-community-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@
# with:
# distro: amplicon
# release-epoch: 2024.10
# additional-pkg-deps:
# github-org-name: qiime2
# github-repo-name: q2-vizard
# TODO: note that default is 'main'; users can leave blank if this is their ref
# TODO: note that default is main branch; can leave blank unless special target
# github-env-ref: dev
# env-file-name: 2024.5-vizard-environment.yml

Expand All @@ -31,13 +30,6 @@ on:
type: number
required: true

# TODO: figure out how to pass multiple external deps in correct syntax
additional-pkg-deps:
description: "Additional package dependencies"
type: string
required: false
default: ''

github-org:
description: "Organization or username on Github"
type: string
Expand All @@ -52,7 +44,7 @@ on:
description: "Target branch/ref name on Github for environment file"
type: string
required: false
default: 'main'
default: ''

env-file-name:
description: "Name of environment file to test with"
Expand All @@ -67,91 +59,31 @@ jobs:
runs-on: ${{ matrix.os }}

env:
github_repo: ${{ inputs.github-repo }}
github_org: ${{ inputs.github-org }}
github_env_ref: ${{ inputs.github-env-ref }}
env_file_name: ${{ inputs.env-file-name }}
plugin_path: ./repo
name: ${{ inputs.github-repo }}
filepath: https://raw.githubusercontent.com/${{ inputs.github-org }}/${{ inputs.github-repo }}/${{ inputs.github-env-ref }}/environment-files/${{ inputs.env-file-name }}

steps:
- uses: actions/checkout@v3

- uses: conda-incubator/setup-miniconda@v3
with:
path: ${{ env.plugin_path }}
fetch-depth: 0
miniconda-version: 'latest'
python-version: 3.9
environment-file: ${{ env.filepath }}
activate-environment: ${{ env.name }}

- name: 'Install and activate test environment'
- name: 'install pytest, run qiime info & run tests'
shell: bash -el {0}
run: |
conda env create
-n ${{ env.github_repo }}
-f https://raw.githubusercontent.com/{{ github-org }}/{{ github-repo }}/{{ github-env-ref }}/environment-files/{{ env-file-name }}
conda activate ${{ env.github_repo }}
conda install pytest
qiime info
pytest
# - name: 'Install and activate test environment'
# run: |
# conda env create
# -n ${{ env.github_repo }}
# -f https://raw.githubusercontent.com/{{ github-org }}/{{ github-repo }}/{{ github-env-ref }}/environment-files/{{ env-file-name }}
# conda activate ${{ env.github_repo }}

# TODO: run tests using makefile
- name: 'Run tests for ${{ env.github_repo }}'


# USING AS A REFERENCE, DONT ERASE ME YET

# jobs:
# build-and-test:
# name: '${{ github.event.repository.name }} (${{ matrix.os }})'
# needs: setup
# strategy:
# fail-fast: false
# matrix:
# os: [ubuntu-latest, macos-12]
# runs-on: ${{ matrix.os }}
# env:
# plugin_path: ./repo
# built_channel_path: ./built-channel
# epoch: ${{ needs.setup.outputs.active-epoch }}
# seed_env_path: ${{ needs.setup.outputs.active-epoch }}/${{ inputs.distro }}/staged/seed-environment-conda.yml
# env_prefix: ./test-env
# steps:
# - uses: actions/checkout@v3
# with:
# path: ${{ env.plugin_path }}
# fetch-depth: 0

# - name: 'Set up test environment'
# run: |
# conda create -y -p ${{ env.env_prefix }}
# mkdir -p ${{ env.env_prefix }}/etc
# cat <<EOF > '${{ env.env_prefix }}/etc/activate.sh'
# . "$CONDA/etc/profile.d/conda.sh"
# conda activate '${{ env.env_prefix }}'
# EOF
# chmod +x '${{ env.env_prefix }}/etc/activate.sh'

# - name: 'set up yaml for test env'
# shell: bash
# run: |
# source ${{ env.env_prefix }}/etc/activate.sh
# conda activate '${{ env.env_prefix }}'
# pip install pyyaml

# - uses: qiime2/action-library-packaging/test-package@beta
# name: 'Test ${{ github.event.repository.name }}'
# with:
# conda-activate: source ${{ env.env_prefix }}/etc/activate.sh
# package-path: ${{ env.built_channel_path }}/${{ steps.build-package.outputs.conda-subdir }}/${{ steps.build-package.outputs.package-filename }}
# channels: ${{ steps.make-cbc.outputs.channels }}

# lint:
# runs-on: ubuntu-latest
# steps:
# - name: checkout source
# uses: actions/checkout@v3

# - name: set up python 3.9
# uses: actions/setup-python@v4
# with:
# python-version: 3.9

# - name: install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install -q flake8

# - name: run flake8
# run: flake8

0 comments on commit 4598530

Please sign in to comment.