-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[infra/github] Introduce workflow for rootfs generation (#14537)
This commit introduces a GitHub Actions workflow to generate the rootfs ONE-DCO-1.0-Signed-off-by: Hyeongseok Oh <[email protected]> Co-authored-by: SaeHie Park <[email protected]>
- Loading branch information
1 parent
8543108
commit 55ebd1b
Showing
1 changed file
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Generate root file system for CI/CD cross build | ||
name: 'Generate RootFS' | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
- release/* | ||
paths: | ||
- '.github/workflows/generate-rootfs.yml' | ||
- 'tools/cross/**' | ||
push: | ||
branches: | ||
- master | ||
- release/* | ||
paths: | ||
- '.github/workflows/generate-rootfs.yml' | ||
- 'tools/cross/**' | ||
schedule: | ||
# Every 1st day of the month at midnight (KST, UTC+9:00) | ||
- cron: '0 15 1 * *' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
gen-rootfs: | ||
if: github.repository_owner == 'Samsung' | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
matrix: | ||
os: [ focal, jammy, noble ] | ||
arch: [ arm, aarch64 ] | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Install qemu | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Install debootstrap | ||
run: sudo apt-get update && sudo apt-get install -y debootstrap | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Generate RootFS | ||
run: | | ||
pushd tools/cross | ||
sudo ./install_rootfs.sh ${{ matrix.arch }} ${{ matrix.os }} --skipunmount | ||
sudo umount --recursive rootfs || true | ||
sudo chown -R $(id -u):$(id -g) rootfs/${{ matrix.arch }} | ||
tar -zcvf rootfs_${{ matrix.arch }}_${{ matrix.os }}.tar.gz -C rootfs \ | ||
${{ matrix.arch }}/usr ${{ matrix.arch }}/etc | ||
popd | ||
mv tools/cross/rootfs_${{ matrix.arch }}_${{ matrix.os }}.tar.gz . | ||
- name: Archive RootFS for PR | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: rootfs_${{ matrix.arch }}_${{ matrix.os }} | ||
# Set short-lived artifacts for PRs only to avoid cluttering the storage. | ||
retention-days: ${{ github.event_name == 'pull_request' && '3' || '60' }} | ||
path: rootfs_${{ matrix.arch }}_${{ matrix.os }}.tar.gz |