<commit_before># name: Qiita Plugin CI

on:
  push:
    branches: [ dev ]
  pull_request:

jobs:
  # derived from https://github.com/actions/example-services/blob/master/.github/workflows/postgres-service.yml
  main:
    runs-on: ubuntu-latest

    services:
      postgres:
        # Docker Hub image
        image: postgres:9.5
        env:
          POSTGRES_DB: postgres
          POSTGRES_USER: postgres
          POSTGRES_PASSWORD: <PASSWORD>
          COVER_PACKAGE: ${{ matrix.cover_package }}

        # Set health checks to wait until postgres has started
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
        ports:
          # based on https://github.com/actions/example-services/blob/master/.github/workflows/postgres-service.yml#L44-L72
          - 5432/tcp

    steps:
      # Downloads a copy of the code in your repository before running CI tests
      - name: Check out repository code
        uses: actions/checkout@v2

      - name: Setup for conda
        uses: conda-incubator/setup-miniconda@v2
        with:
          auto-update-conda: true
          python-version: 3.6

      - name: Basic dependencies install
        env:
          COVER_PACKAGE: ${{ matrix.cover_package }}
        shell: bash -l {0}
        run: |
          echo "Testing: " $COVER_PACKAGE

          # we need to download qiita directly so we have "easy" access to
          # all config files
          wget https://github.com/biocore/qiita/archive/dev.zip
          unzip dev.zip

          # pull out the port so we can modify the configuration file easily
          pgport=${{ job.services.postgres.ports[5432] }}
          sed -i "s/PORT = 5432/PORT = $pgport/" qiita-dev/qiita_core/support_files/config_test.cfg

          # PGPASSWORD is read by pg_restore, which is called by the build_db process.
          export PGPASSWORD=<PASSWORD>

          # Setting up main qiita conda environment
          conda config --add channels conda-forge
          conda create -q --yes -n qiita python=3.6 pip==9.0.3 libgfortran numpy nginx cython redis
          conda activate qiita
          pip install -U pip
          pip install sphinx sphinx-bootstrap-theme nose-timer codecov Click

      - name: Qiita install
        shell: bash -l {0}
        run: |
          conda activate qiita
          pip install qiita-dev/ --no-binary redbiom
          mkdir ~/.qiita_plugins

      - name: Install Qiita plugins
        shell: bash -l {0}
        run: |
          wget --quiet https://data.qiime2.org/distro/core/qiime2-2022.8-py38-linux-conda.yml
          conda env create -n qiime2 --quiet --file qiime2-2022.8-py38-linux-conda.yml
          rm qiime2-2022.8-py38-linux-conda.yml

          conda activate qiime2
          pip uninstall h5py
          pip install --no-cache-dir h5py

          # configuring the databases available for QIIME 2

          mkdir databases
          wget --quiet -O "databases/gg-13-8-99-515-806-nb-classifier.qza" "https://data.qiime2.org/2021.4/common/gg-13-8-99-515-806-nb-classifier.qza"

          export QIITA_SERVER_CERT=`pwd`/qiita-dev/qiita_core/support_files/server.crt
          export QIITA_CONFIG_FP=`pwd`/qiita-dev/qiita_core/support_files/config_test_local.cfg<commit_msg>rm pip install/uninstall h5py<commit_after># name: Qiita Plugin CI

on:
  push:
    branches: [ dev ]
  pull_request:

jobs:
  # derived from https://github.com/actions/example-services/blob/master/.github/workflows/postgres-service.yml
  main:
    runs-on: ubuntu-latest

    services:
      postgres:
        # Docker Hub image
        image: postgres:9.5
        env:
          POSTGRES_DB: postgres
          POSTGRES_USER: postgres
          POSTGRES_PASSWORD: <PASSWORD>
          COVER_PACKAGE: ${{ matrix.cover_package }}

        # Set health checks to wait until postgres has started
        options: >-
          --health-cmd pg_isready
          --health-interval 10s
          --health-timeout 5s
          --health-retries 5
        ports:
          # based on https://github.com/actions/example-services/blob/master/.github/workflows/postgres-service.yml#L44-L72
          - 5432/tcp

    steps:
      # Downloads a copy of the code in your repository before running CI tests
      - name: Check out repository code
        uses: actions/checkout@v2

      - name: Setup for conda
        uses: conda-incubator/setup-miniconda@v2
        with:
          auto-update-conda: true
          python-version: 3.6

      - name: Basic dependencies install
        env:
          COVER_PACKAGE: ${{ matrix.cover_package }}
        shell: bash -l {0}
        run: |
          echo "Testing: " $COVER_PACKAGE

          # we need to download qiita directly so we have "easy" access to
          # all config files
          wget https://github.com/biocore/qiita/archive/dev.zip
          unzip dev.zip

          # pull out the port so we can modify the configuration file easily
          pgport=${{ job.services.postgres.ports[5432] }}
          sed -i "s/PORT = 5432/PORT = $pgport/" qiita-dev/qiita_core/support_files/config_test.cfg

          # PGPASSWORD is read by pg_restore, which is called by the build_db process.
          export PGPASSWORD=<PASSWORD>

          # Setting up main qiita conda environment
          conda config --add channels conda-forge
          conda create -q --yes -n qiita python=3.6 pip==9.0.3 libgfortran numpy nginx cython redis
          conda activate qiita
          pip install -U pip
          pip install sphinx sphinx-bootstrap-theme nose-timer codecov Click

      - name: Qiita install
        shell: bash -l {0}
        run: |
          conda activate qiita
          pip install qiita-dev/ --no-binary redbiom
          mkdir ~/.qiita_plugins

      - name: Install Qiita plugins
        shell: bash -l {0}
        run: |
          wget --quiet https://data.qiime2.org/distro/core/qiime2-2022.8-py38-linux-conda.yml
          conda env create -n qiime2 --quiet --file qiime2-2022.8-py38-linux-conda.yml
          rm qiime2-2022.8-py38-linux-conda.yml

          conda activate qiime2

          # configuring the databases available for QIIME 2

          mkdir databases
          wget --quiet -O "databases/gg-13-8-99-515-806-nb-classifier.qza" "https://data.qiime2.org/2021.4/common/gg-13-8-99-515-806-nb-classifier.qza"

          export QIITA_SERVER_CERT=`pwd`/qiita-dev/qiita_core/support_files/server.crt
          export QIITA_CONFIG_FP=`pwd`/qiita-dev/qiita_core/support_files/config_test_local.cfg
{'fraction_non_alphanumeric': 0.09253912779212886, 'fraction_numerical': 0.02780732411487616, 'mean_word_length': 1.9809782608695652, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1440809', 'n_tokens_mistral': 2262, 'n_tokens_neox': 2057, 'n_words': 519}