run #15468
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: run | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: "0,15,30,45 * * * *" | |
workflow_dispatch: null | |
jobs: | |
run: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Prevent multiple jobs running in parallel | |
id: conversion_lock | |
uses: beckermr/turnstyle-python@v1 | |
with: | |
abort-after-seconds: 3 | |
poll-interval-seconds: 2 | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
continue-on-error: true | |
- uses: actions/checkout@v2 | |
# outcome is evaluated before continue-on-error above | |
if: steps.conversion_lock.outcome == 'success' | |
- name: fast finish | |
if: ${{ steps.conversion_lock.outcome == 'success' }} | |
run: | | |
set -x | |
# avoid wasting CI time if there is nothing to do | |
broken_count="$(ls broken/*.txt | grep -v broken/example.txt | wc -l)" | |
not_broken_count="$(ls not_broken/*.txt | grep -v not_broken/example.txt | wc -l)" | |
token_reset_count="$(ls token_reset/*.txt | grep -v token_reset/example.txt | wc -l)" | |
archive_count="$(ls archive/*.txt | grep -v archive/example.txt | wc -l)" | |
unarchive_count="$(ls unarchive/*.txt | grep -v unarchive/example.txt | wc -l)" | |
if [[ "${broken_count}" == "0" && "${not_broken_count}" == "0" | |
&& "${token_reset_count}" == "0" | |
&& "${archive_count}" == "0" && "${unarchive_count}" == "0" | |
]]; then | |
echo "nothing to do, setting ci skip!" | |
echo "CI_SKIP=true" >> $GITHUB_ENV | |
fi | |
- uses: conda-incubator/setup-miniconda@v2 | |
if: steps.conversion_lock.outcome == 'success' && ! env.CI_SKIP | |
with: | |
activate-environment: cf | |
environment-file: environment.yml | |
auto-activate-base: true | |
miniforge-version: latest | |
miniforge-variant: Mambaforge | |
use-mamba: true | |
- name: Generate token | |
if: steps.conversion_lock.outcome == 'success' && ! env.CI_SKIP | |
id: generate_token | |
uses: conda-forge/github-app-token@e3ab451d57e120b956292a1fa1d21fe4ba171c36 | |
with: | |
app_id: ${{ secrets.CF_CURATOR_APP_ID }} | |
private_key: ${{ secrets.CF_CURATOR_PRIVATE_KEY }} | |
- name: mark packages as broken | |
if: steps.conversion_lock.outcome == 'success' && ! env.CI_SKIP | |
shell: bash -el {0} | |
run: | | |
conda activate cf | |
git config --global user.email "79913779+conda-forge-curator[bot]@users.noreply.github.com" | |
git config --global user.name "conda-forge-curator[bot]" | |
git config --global pull.rebase false | |
python mark_broken.py mark | |
env: | |
BINSTAR_TOKEN: ${{ secrets.PROD_BINSTAR_TOKEN }} | |
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} | |
- name: reset feedstock tokens | |
if: steps.conversion_lock.outcome == 'success' && ! env.CI_SKIP | |
shell: bash -el {0} | |
run: | | |
conda activate cf | |
git config --global user.email "79913779+conda-forge-curator[bot]@users.noreply.github.com" | |
git config --global user.name "conda-forge-curator[bot]" | |
git config --global pull.rebase false | |
python token_reset.py reset | |
env: | |
STAGING_BINSTAR_TOKEN: ${{ secrets.STAGING_BINSTAR_TOKEN }} | |
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} | |
CIRCLE_TOKEN: ${{ secrets.CIRCLE_TOKEN }} | |
TRAVIS_TOKEN: ${{ secrets.CF_ADMIN_TRAVIS_TOKEN }} | |
AZURE_TOKEN: ${{ secrets.AZURE_TOKEN }} | |
DRONE_TOKEN: ${{ secrets.DRONE_TOKEN }} | |
- name: (un)archive feedstocks | |
if: steps.conversion_lock.outcome == 'success' && ! env.CI_SKIP | |
shell: bash -el {0} | |
run: | | |
conda activate cf | |
git config --global user.email "79913779+conda-forge-curator[bot]@users.noreply.github.com" | |
git config --global user.name "conda-forge-curator[bot]" | |
git config --global pull.rebase false | |
python archive_feedstock.py archive | |
env: | |
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} | |
- name: pull changes | |
if: steps.conversion_lock.outcome == 'success' && ! env.CI_SKIP | |
shell: bash -el {0} | |
run: | | |
git pull | |
- name: Push changes | |
if: steps.conversion_lock.outcome == 'success' && ! env.CI_SKIP | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} |