4
|
1 name: Galaxy Tool Linting and Tests for PR
|
|
2 # run planemo on a git repository containing a single tool
|
|
3 # as a github action.
|
|
4 # ross lazarus august 2020
|
|
5 on: [pull_request,push]
|
|
6 env:
|
|
7 GALAXY_REPO: https://github.com/galaxyproject/galaxy
|
|
8 GALAXY_RELEASE: release_20.05
|
|
9 jobs:
|
|
10 setup:
|
|
11 name: setup environment and python
|
|
12 runs-on: ubuntu-latest
|
|
13 strategy:
|
|
14 matrix:
|
|
15 python-version: [3.7]
|
|
16 steps:
|
|
17 - name: Print github context properties
|
|
18 run: |
|
|
19 echo 'event: ${{ github.event_name }}'
|
|
20 echo 'sha: ${{ github.sha }}'
|
|
21 echo 'ref: ${{ github.ref }}'
|
|
22 echo 'head_ref: ${{ github.head_ref }}'
|
|
23 echo 'base_ref: ${{ github.base_ref }}'
|
|
24 echo 'event.before: ${{ github.event.before }}'
|
|
25 echo 'event.after: ${{ github.event.after }}'
|
|
26 - uses: actions/setup-python@v1
|
|
27 with:
|
|
28 python-version: ${{ matrix.python-version }}
|
|
29 - uses: actions/checkout@v2
|
|
30 with:
|
|
31 # planemo does not seem to want to install the requirement galaxyxml
|
|
32 # into the venv it manages at tool testing so do it the old skool way
|
|
33 repository: 'galaxyproject/galaxy'
|
|
34 path: 'galaxy'
|
|
35 - name: make venv ready for this galaxy and planemo
|
|
36 run: |
|
|
37 python3 -m venv $GITHUB_WORKSPACE/galaxy/.venv
|
|
38 . $GITHUB_WORKSPACE/galaxy/.venv/bin/activate
|
|
39 pip install --upgrade pip
|
|
40 pip install wheel
|
|
41 pip install -r $GITHUB_WORKSPACE/galaxy/requirements.txt
|
|
42 - name: Upgrade pip
|
|
43 run: pip install --upgrade pip
|
|
44 # Install the `wheel` package so that when installing other packages which
|
|
45 # are not available as wheels, pip will build a wheel for them, which can be cached.
|
|
46 - name: Install wheel
|
|
47 run: pip install wheel
|
|
48 - name: Install Planemo and flake8
|
|
49 run: pip install planemo flake8 flake8-import-order
|
|
50 # galaxyxml temporarily removed until PR accepted
|
|
51 - uses: actions/checkout@v2
|
|
52 with:
|
|
53 fetch-depth: 1
|
|
54 - name: flake8 *.py
|
|
55 run: flake8 --ignore=E501,E203,W503,C901
|
|
56 - name: Planemo lint
|
|
57 run: planemo lint .
|
|
58 - name: Planemo test tool
|
|
59 run: planemo test --galaxy_root $GITHUB_WORKSPACE/galaxy --test_output tool_test_output.html --skip_venv --test_output_json tool_test_output.json --galaxy_python_version ${{ matrix.python-version }} .
|
|
60 - name: Copy artifacts into place
|
|
61 run: |
|
|
62 mkdir upload
|
|
63 mv tool_test_output.json tool_test_output.html upload/
|
|
64 - uses: actions/upload-artifact@v2.0.1
|
|
65 with:
|
|
66 name: 'All tool test results'
|
|
67 path: upload
|