make submissions folder deletion better (#445) #183
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
# Continuous integration and delivery of the main branch. | |
name: CI/CD | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
# Run Python tests on Github runner | |
tox_test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.7] | |
steps: | |
- name: Checkout github repo (+ download lfs dependencies) | |
uses: actions/checkout@v2 | |
with: | |
lfs: true | |
- name: Checkout LFS objects | |
run: git lfs checkout | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
$CONDA/bin/conda install -y -c bioconda womtool | |
$CONDA/bin/conda config --add channels conda-forge | |
$CONDA/bin/conda install -y -c conda-forge miniwdl shellcheck | |
echo "$CONDA/bin" >> $GITHUB_PATH | |
- name: Test with tox | |
run: tox | |
# Send Slack message on workflow failure | |
- name: Slack Failure Notification | |
if: failure() | |
uses: rtCamp/[email protected] | |
env: | |
SLACK_COLOR: '#DF5A49' | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_ICON: https://github.com/broadinstitute/long-read-pipelines/blob/main/.github/workflows/dnabad.png?raw=true | |
SLACK_USERNAME: long-read-pipelines | |
main_test: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# Runs a set of commands using the runners shell | |
- name: Continuous integration test suite | |
run: | | |
echo 'Test temporarily disabled.' | |
# Send Slack message on workflow failure | |
- name: Slack Failure Notification | |
if: failure() | |
uses: rtCamp/[email protected] | |
env: | |
SLACK_COLOR: '#DF5A49' | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_ICON: https://github.com/broadinstitute/long-read-pipelines/blob/main/.github/workflows/dnabad.png?raw=true | |
SLACK_USERNAME: long-read-pipelines | |
# Send Slack message on workflow success | |
- name: Slack Success Notification | |
if: success() | |
uses: rtCamp/[email protected] | |
env: | |
SLACK_COLOR: '#50D9C9' | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_ICON: https://github.com/broadinstitute/long-read-pipelines/blob/main/.github/workflows/dnagood.png?raw=true | |
SLACK_USERNAME: long-read-pipelines | |
deliver: | |
# Automatic delivery will run on a Github-hosted machine | |
needs: main_test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Read Current Version | |
id: read_property | |
uses: christian-draeger/[email protected] | |
with: | |
path: 'VERSION' | |
property: 'version' | |
- name: Current Version | |
run: echo ${{ steps.read_property.outputs.value }} | |
- name: Generate Release Notes | |
# Retrieves the commit message from the last commit in current branch (main) | |
# and writes it to a file called release_notes.txt | |
run: git log --format=%B -n 1 ${{ github.event.after }} > release_notes.txt | |
- name: Github Bumpversion Action | |
id: version-bump | |
uses: jasonamyers/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
DEFAULT_BUMP: "patch" | |
- name: New Version | |
run: echo ${{ steps.version-bump.outputs.new_ver }} | |
- name: Push Changes To Master/Main | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
tags: true | |
- name: Create Github release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.version-bump.outputs.new_ver }} | |
release_name: 'lrp_${{ steps.version-bump.outputs.new_ver }}' | |
body_path: "release_notes.txt" | |
draft: false | |
prerelease: false | |
- name: Slack Failure Notification | |
if: failure() | |
uses: rtCamp/[email protected] | |
env: | |
SLACK_MESSAGE: 'Failed to release version lrp_${{ steps.bump_version.outputs.next-version }}' | |
SLACK_COLOR: '#DF5A49' | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_ICON: https://github.com/broadinstitute/long-read-pipelines/blob/main/.github/workflows/dnabad.png?raw=true | |
SLACK_USERNAME: long-read-pipelines | |
- name: Slack Success Notification | |
if: success() | |
uses: rtCamp/[email protected] | |
env: | |
SLACK_MESSAGE: 'Successfully released version lrp_${{ steps.bump_version.outputs.next-version }}' | |
SLACK_COLOR: '#50D9C9' | |
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} | |
SLACK_ICON: https://github.com/broadinstitute/long-read-pipelines/blob/main/.github/workflows/dnagood.png?raw=true | |
SLACK_USERNAME: long-read-pipelines |