Skip to content

Integration Tests

Integration Tests #18

on:
push:
branches:
- main
pull_request:
workflow_dispatch: # Trigger workflow manually from GitHub UI
name: Full Build Integration Tests
jobs:
## Integration tests ##
integration-rattler:
runs-on: ubuntu-latest
timeout-minutes: 45
name: Test on ${{ matrix.test-directory }}
strategy:
fail-fast: false
matrix:
test-directory:
- anaconda_recipes_01
include:
- test-directory: anaconda_recipes_01
convert-success: 0.90
rattler-success: 0.75
steps:
# Checkout the main repository
- uses: actions/checkout@v4
# Checkout the test data repository
- uses: actions/checkout@v4
with:
repository: conda-incubator/conda-recipe-manager-test-data
path: test_data
sparse-checkout: |
recipes_v0/anaconda_recipes_01
# Set up Conda environment
- name: Set up Conda environment
uses: conda-incubator/setup-miniconda@v2
with:
conda-version: 'latest' # Automatically use the latest version of conda
python-version: '3.11'
auto-activate-base: false # Do not auto-activate the base environment
# Install necessary dependencies
- name: Install dependencies
run: |
conda create -y -n conda-recipe-manager python=3.11
conda activate conda-recipe-manager
conda install -y -c conda-forge rattler-build jq
conda install -y -c conda-forge conda-recipe-manager # Install CRM
# Clean up unnecessary files to free space
- name: Clean up unnecessary files
run: |
rm -rf ~/.cache/pip
rm -rf /home/runner/work/_temp/*
# Load the allow-list and process each recipe
- name: Load Allow-List and Full Build with rattler-build
run: |
echo "Loading allow-list from integration_build_test_config.json"
ALLOW_LIST=$(cat integration_build_test_config.json | jq -r '.v0_test_files[]')
echo "$ALLOW_LIST" > allow_list.txt
mkdir -p logs
set -o pipefail
while read -r recipe; do
echo "Processing recipe: $recipe"
crm convert "$recipe" --output recipe.yaml | tee -a logs/convert.log
rattler-build build recipe.yaml | tee -a logs/build.log || echo "Build failed for $recipe" >> logs/failed_recipes.log
done < allow_list.txt
# Upload logs
- uses: actions/upload-artifact@v4
with:
name: integration-logs-${{ matrix.test-directory }}
path: logs/*.log
# Final Results
integration-final-results:
runs-on: ubuntu-latest
name: Integration Testing Final Report
needs: [integration-rattler]
timeout-minutes: 5
steps:
# Checkout the repository again
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
# Set up Conda environment again for the report generation
- uses: ./.github/actions/setup-env
with:
python-version: "3.11"
- name: Make artifact directory
run: mkdir -p logs
# Download logs
- uses: actions/download-artifact@v4
with:
name: integration-logs-${{ matrix.test-directory }}
path: logs/
# Generate the final report
- name: Integration Testing Report
run: |
source $CONDA/bin/activate
conda activate conda-recipe-manager
set -o pipefail
scripts/parse_ci_output.py logs/ | tee report.json
echo -e "Integration Report:\n\`\`\`json\n" >> ${GITHUB_STEP_SUMMARY}
cat report.json >> ${GITHUB_STEP_SUMMARY}
echo -e "\n\`\`\`" >> ${GITHUB_STEP_SUMMARY}