|
11 | 11 | types: [published] |
12 | 12 |
|
13 | 13 | jobs: |
14 | | - tests: |
15 | | - name: Run unit tests |
16 | | - runs-on: ubuntu-latest |
17 | | - strategy: |
18 | | - matrix: |
19 | | - python-version: [3.7] |
20 | | - steps: |
21 | | - - name: Checkout code |
22 | | - uses: actions/checkout@v2 |
23 | | - - name: Set up Python ${{ matrix.python-version }} |
24 | | - uses: actions/setup-python@v2 |
25 | | - with: |
26 | | - python-version: ${{ matrix.python-version }} |
27 | | - - name: Install dependencies |
28 | | - run: | |
29 | | - python -m pip install pip -U |
30 | | - pip install tox codecov |
31 | | - - name: Set TOXENV |
32 | | - run: | |
33 | | - python_version="${{ matrix.python-version }}" |
34 | | - py_version="${python_version/./}" |
35 | | - target_branch=${{ github.base_ref || github.ref }} |
36 | | - target_branch=(`[[ ${target_branch::10} == 'refs/heads' ]] && echo ${target_branch:11} || echo $target_branch`) |
37 | | - echo "target_branch =" $target_branch |
38 | | - is_master=(`[[ $target_branch == 'master' ]] && echo 'true' || echo 'false'`) |
39 | | - is_tag=${{ startsWith(github.ref, 'refs/tags') }} |
40 | | - echo "is_master =" $is_master |
41 | | - echo "is_tag =" $is_tag |
42 | | - branch=(`[[ $is_master == 'true' || $is_tag == 'true' ]] && echo 'master' || echo 'dev'`) |
43 | | - TOXENV="py$py_version-$branch" |
44 | | - echo $TOXENV |
45 | | - echo "TOXENV=$TOXENV" >> $GITHUB_ENV |
46 | | - - name: Run tox |
47 | | - run: tox |
48 | | - - name: Upload coverage report |
49 | | - uses: codecov/codecov-action@v1 |
50 | | - with: |
51 | | - file: .coverage |
52 | | - fail_ci_if_error: true |
53 | | - verbose: true |
54 | 14 | pre-commit: |
55 | 15 | name: Run pre-commit |
56 | 16 | runs-on: ubuntu-latest |
|
110 | 70 | git checkout -qf ${{ github.head_ref }} |
111 | 71 | ! diff <(yq .metadata.template_version shell-definition.yaml) <(git show master:shell-definition.yaml > tmp.yaml && yq .metadata.template_version tmp.yaml) |
112 | 72 | create-gh-release: |
113 | | - needs: [tests, pre-commit, pack] |
| 73 | + needs: [pre-commit, pack] |
114 | 74 | if: ${{ github.ref == 'refs/heads/master' && github.event_name == 'push' }} |
115 | 75 | runs-on: ubuntu-latest |
116 | 76 | steps: |
|
0 commit comments