|
3 | 3 | name: CI |
4 | 4 |
|
5 | 5 | # Controls when the action will run. Triggers the workflow on push or pull request |
6 | | -# events but only for the master branch |
| 6 | +# events but only for the main branch |
7 | 7 | on: |
8 | 8 | push: |
9 | | - branches: [ master ] |
| 9 | + branches: [ master, main ] |
10 | 10 | pull_request: |
11 | | - branches: [ master ] |
| 11 | + branches: [ master, main ] |
12 | 12 |
|
13 | 13 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel |
14 | 14 | jobs: |
15 | 15 | # This workflow contains a single job called "build" |
16 | | - build: |
| 16 | + check-submodules: |
17 | 17 | # The type of runner that the job will run on |
18 | 18 | runs-on: ubuntu-latest |
19 | 19 |
|
20 | 20 | # Steps represent a sequence of tasks that will be executed as part of the job |
21 | 21 | steps: |
22 | 22 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
23 | | - - uses: actions/checkout@v2 |
24 | | - |
25 | | - - name: Check all commits in git submodules available |
26 | | - run: git submodule init && git submodule update --recursive --remote |
| 23 | + - uses: actions/checkout@v3 |
| 24 | + with: |
| 25 | + submodules: recursive |
27 | 26 |
|
28 | 27 | - name: Check all submodules up-to-date |
29 | 28 | run: git diff --exit-code |
30 | 29 |
|
| 30 | + check-master: |
| 31 | + runs-on: ubuntu-latest |
| 32 | + needs: [check-submodules] |
| 33 | + steps: |
| 34 | + - uses: actions/checkout@v3 |
| 35 | + with: |
| 36 | + submodules: recursive |
| 37 | + |
| 38 | + - name: Check master points to main |
| 39 | + run: | |
| 40 | + for s in ./submodules/*/ ; do |
| 41 | + pushd "$s" |
| 42 | + rem_master_hash=$(git ls-remote --exit-code --quiet --heads origin master | awk '{ print $1}') |
| 43 | + git diff --exit-code ${rem_master_hash} || (echo "Broken Master in $s" ; exit 1) |
| 44 | + popd > /dev/null |
| 45 | + done |
| 46 | +
|
| 47 | + check-urls: |
| 48 | + runs-on: ubuntu-latest |
| 49 | + steps: |
| 50 | + - uses: actions/checkout@v3 |
| 51 | + |
31 | 52 | - name: Check all URLs |
32 | 53 | run: ./scripts/check_all_urls.sh |
33 | 54 |
|
|
0 commit comments