annotate toolfactory/.github/workflows/commit.yml @ 4:2a46da701dde draft

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