forked from epfl-lasa/modulo
-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (70 loc) · 2.42 KB
/
build-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Build and Test
# Run workflow on pushes to main and develop branches, on any pull request, or by manual dispatch
on:
push:
branches:
- main
- develop
pull_request:
workflow_dispatch:
# Define the build test jobs
jobs:
check-contribution:
name: Check if changelog and version have been updated
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Check contributions
if: ${{ github.event.pull_request.base.sha }}
run: |
git fetch origin main ${{ github.event.pull_request.base.sha }}
VER_DIFF=$(git diff ${{ github.event.pull_request.base.sha }} ${{ github.sha }} -- ./VERSION)
if ! [ "${VER_DIFF}" ]; then
echo "::warning title=Contribution check failed::VERSION must be updated!"
exit 1
fi
CL_DIFF=$(git diff ${{ github.event.pull_request.base.sha }} ${{ github.sha }} -- ./CHANGELOG.md)
if ! [ "${CL_DIFF}" ]; then
echo "::warning title=Contribution check failed::CHANGELOG.md must be updated!"
exit 1
fi
shell: bash
# check if jobs can be skipped
check-skippable-changes:
name: Check skippable changes
runs-on: ubuntu-latest
outputs:
skip: ${{ steps.check_if_skippable.outputs.should_skip }}
steps:
- id: check_if_skippable
uses: fkirc/skip-duplicate-actions@master
with:
cancel_others: 'true'
do_not_skip: '["workflow_dispatch"]'
paths_ignore: '["**.md"]'
skip_after_successful_duplicate: 'true'
build-test-humble:
needs: check-skippable-changes
if: ${{ needs.check-skippable-changes.outputs.skip != 'true' }}
runs-on: ubuntu-latest
name: Humble build and test
steps:
# First check out the repository
- name: Checkout
uses: actions/checkout@v3
# Load the repository build-test action
- name: Build and Test
uses: ./.github/actions/build-test-humble
build-test-humble-devel:
needs: check-skippable-changes
if: ${{ needs.check-skippable-changes.outputs.skip != 'true' }}
runs-on: ubuntu-latest
name: Humble development build and test
steps:
# First check out the repository
- name: Checkout
uses: actions/checkout@v2
# Load the repository build-test action
- name: Build and Test
uses: ./.github/actions/build-test-humble-devel