Skip to content

Commit 4bcd8cc

Browse files
committed
CI: Update github actions
1 parent 62cad42 commit 4bcd8cc

File tree

3 files changed

+53
-23
lines changed

3 files changed

+53
-23
lines changed

.github/workflows/ci.yaml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
pull_request:
99
push:
1010

11+
permissions:
12+
contents: read # to fetch code (actions/checkout)
13+
1114
jobs:
1215
default:
1316
strategy:
@@ -26,38 +29,42 @@ jobs:
2629
name: ${{ matrix.env.IMAGE }}${{ matrix.env.CATKIN_LINT && ' + catkin_lint' || ''}}${{ matrix.env.CLANG_TIDY && ' + clang-tidy' || '' }}
2730
runs-on: ubuntu-latest
2831
steps:
29-
- uses: actions/checkout@v2
32+
- uses: actions/checkout@v3
3033
# The target directory cache doesn't include the source directory because
3134
# that comes from the checkout. See "prepare target_ws for cache" task below
32-
- name: cache target_ws
33-
uses: pat-s/[email protected]
35+
- name: Cache target workspace
36+
if: "!matrix.env.CCOV"
37+
uses: rhaschke/cache@main
3438
with:
3539
path: ${{ env.BASEDIR }}/target_ws
3640
key: ${{ env.CACHE_PREFIX }}-${{ github.run_id }}
3741
restore-keys: ${{ env.CACHE_PREFIX }}
3842
env:
43+
GHA_CACHE_SAVE: always
3944
CACHE_PREFIX: target_ws-${{ matrix.env.IMAGE }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }}
40-
- name: cache ccache
41-
uses: pat-s/always-upload-cache@v2.1.5
45+
- name: Cache ccache
46+
uses: rhaschke/cache@main
4247
with:
4348
path: ${{ env.CCACHE_DIR }}
4449
key: ${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }}
4550
restore-keys: |
4651
${{ env.CACHE_PREFIX }}-${{ github.sha }}
4752
${{ env.CACHE_PREFIX }}
4853
env:
54+
GHA_CACHE_SAVE: always
4955
CACHE_PREFIX: ccache-${{ matrix.env.IMAGE }}
5056

51-
- name: industrial_ci
57+
- name: Run industrial_ci
5258
uses: ros-industrial/industrial_ci@master
59+
env: ${{ matrix.env }}
5360

54-
- name: upload test artifacts (on failure)
55-
uses: actions/upload-artifact@v2
56-
if: failure()
61+
- name: Upload test artifacts (on failure)
62+
uses: actions/upload-artifact@v3
63+
if: failure() && (steps.ici.outputs.run_target_test || steps.ici.outputs.target_test_results)
5764
with:
58-
name: test-results
65+
name: test-results-${{ matrix.env.IMAGE }}
5966
path: ${{ env.BASEDIR }}/target_ws/**/test_results/**/*.xml
60-
- name: prepare target_ws for cache
67+
- name: Prepare target_ws for cache
6168
if: ${{ always() }}
6269
run: |
6370
du -sh ${{ env.BASEDIR }}/target_ws

.github/workflows/deploy.yaml

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,44 @@ on:
77
branches:
88
- master
99

10+
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
1016
jobs:
11-
default:
17+
doc:
1218
name: Build + Test + Deploy Website
1319
runs-on: ubuntu-latest
1420
container: ros:noetic-ros-base
1521
steps:
16-
- uses: actions/checkout@v2
22+
- uses: actions/checkout@v3
23+
- name: Setup Pages
24+
uses: actions/configure-pages@v2
25+
if: github.repository_owner == 'ros-planning'
1726
- name: "Install ruby"
1827
run: |
1928
apt-get update -q
2029
apt-get install -q -y ruby-dev libffi-dev build-essential git
30+
2131
- name: "Run htmlproofer.sh"
2232
run: ./htmlproofer.sh
23-
- name: Deploy
24-
if: ${{ success() && github.event_name == 'push'}}
25-
uses: peaceiris/actions-gh-pages@v3
33+
34+
- name: Upload pages artifact
35+
uses: actions/upload-pages-artifact@v1
36+
if: github.repository_owner == 'ros-planning'
2637
with:
27-
github_token: ${{ secrets.GITHUB_TOKEN }}
28-
publish_dir: ./build/html
29-
force_orphan: true
38+
path: build/html
39+
40+
deploy:
41+
if: github.repository_owner == 'ros-planning' && github.ref == 'refs/heads/master'
42+
runs-on: ubuntu-latest
43+
needs: doc
44+
environment:
45+
name: github-pages
46+
url: ${{ steps.deployment.outputs.page_url }}
47+
steps:
48+
- name: Deploy to GitHub Pages
49+
id: deployment
50+
uses: actions/deploy-pages@v1

.github/workflows/format.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,18 @@ on:
88
pull_request:
99
push:
1010

11+
permissions:
12+
contents: read # to fetch code (actions/checkout)
13+
1114
jobs:
1215
pre-commit:
1316
name: pre-commit
14-
runs-on: ubuntu-latest
17+
runs-on: ubuntu-20.04
1518
steps:
16-
- uses: actions/checkout@v2
17-
- uses: actions/setup-python@v2
19+
- uses: actions/checkout@v3
1820
- name: Install clang-format-10
1921
run: sudo apt-get install clang-format-10
2022
- uses: rhaschke/[email protected]
2123
with:
2224
distro: noetic
23-
- uses: pre-commit/action@v2.0.0
25+
- uses: pre-commit/action@v3.0.0

0 commit comments

Comments
 (0)