Add Galaxy Tool CI/CD pipeline configuration #1
This file contains hidden or 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: Galaxy Tool CI/CD Pipeline | ||
on: | ||
push: | ||
branches: [ main, master ] | ||
pull_request: | ||
branches: [ main, master ] | ||
release: | ||
types: [ published ] | ||
tag: | ||
types: [ created ] | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' | ||
- name: Create Planemo config | ||
env: | ||
USER: ${{ secrets.USER }} | ||
KEY: ${{ secrets.KEY }} | ||
EMAIL: ${{ secrets.EMAIL }} | ||
PASS: ${{ secrets.PASS }} | ||
run: | | ||
mkdir -p $HOME/.planemo | ||
cat > $HOME/.planemo.yml << EOF | ||
shed_username: $USER # your ToolShed username | ||
sheds: | ||
toolshed: | ||
key: $KEY # your ToolShed API key, under 'User > API Keys' | ||
email: $EMAIL # your ToolShed email | ||
password: $PASS # your ToolShed password | ||
EOF | ||
- name: Install Planemo | ||
run: pip install planemo | ||
- name: Lint Galaxy tool | ||
run: planemo lint structural_validator.xml | ||
- name: Test Galaxy tool | ||
run: planemo test structural_validator.xml | ||
deploy: | ||
needs: test | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.9' | ||
- name: Create Planemo config | ||
env: | ||
USER: ${{ secrets.USER }} | ||
KEY: ${{ secrets.KEY }} | ||
EMAIL: ${{ secrets.EMAIL }} | ||
PASS: ${{ secrets.PASS }} | ||
run: | | ||
mkdir -p $HOME/.planemo | ||
cat > $HOME/.planemo.yml << EOF | ||
shed_username: $USER # your ToolShed username | ||
sheds: | ||
toolshed: | ||
key: $KEY # your ToolShed API key, under 'User > API Keys' | ||
email: $EMAIL # your ToolShed email | ||
password: $PASS # your ToolShed password | ||
EOF | ||
- name: Install Planemo | ||
run: pip install planemo | ||
- name: Update Tool Shed | ||
run: planemo shed_update --shed_target toolshed |