[infra] Replace nnas docker-run with direct docker commands #80
Workflow file for this run
This file contains hidden or 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
| name: Build docker image for CI/CD infra on PR | |
| on: | |
| pull_request: | |
| branches: | |
| - master | |
| paths: | |
| - '.github/workflows/build-dev-docker.yml' | |
| - 'infra/docker/**' | |
| # Cancel previous running jobs when pull request is updated | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| filtering: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| ubuntu-target: ${{ steps.ubuntu-filter.outputs.changes }} | |
| android: ${{ steps.android-filter.outputs.android }} | |
| steps: | |
| - uses: dorny/paths-filter@v3 | |
| id: ubuntu-filter | |
| with: | |
| filters: | | |
| focal: | |
| - '.github/**' | |
| - 'infra/docker/focal/Dockerfile' | |
| jammy: | |
| - '.github/**' | |
| - 'infra/docker/jammy/Dockerfile' | |
| noble: | |
| - '.github/**' | |
| - 'infra/docker/noble/Dockerfile' | |
| - uses: dorny/paths-filter@v3 | |
| id: android-filter | |
| with: | |
| filters: | | |
| android: | |
| - '.github/**' | |
| - 'infra/docker/android-sdk/**' | |
| # Build on docker CLI for PR test without login | |
| build-ubuntu: | |
| needs: filtering | |
| if: github.repository_owner == 'Samsung' && needs.filtering.outputs.ubuntu-target != '[]' | |
| runs-on: one-x64-linux | |
| strategy: | |
| matrix: | |
| version: ${{ fromJSON(needs.filtering.outputs.ubuntu-target) }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Build Docker Image | |
| run: | | |
| docker build --file infra/docker/${{ matrix.version }}/Dockerfile --tag one-test . | |
| - name: Test onert build | |
| if: matrix.version != 'focal' # not supported | |
| run: | | |
| docker run --rm -u root -v "${PWD}:${PWD}" -w "${PWD}" one-test make -f Makefile.template | |
| docker run --rm -u root -v "${PWD}:${PWD}" -w "${PWD}" one-test Product/out/test/onert-test unittest | |
| - name: Download rootfs for cross build | |
| uses: dawidd6/action-download-artifact@v7 | |
| if: matrix.version != 'focal' # not supported | |
| with: | |
| workflow: generate-rootfs.yml | |
| branch: master | |
| name: rootfs_arm_${{ matrix.version }} | |
| # Workaround: symlink for rootfs checker in cmake toolchain file | |
| - name: Install rootfs and cross build | |
| if: matrix.version != 'focal' # not supported | |
| run: | | |
| mkdir -p tools/cross/rootfs | |
| tar -zxf rootfs_arm_${{ matrix.version }}.tar.gz -C tools/cross/rootfs | |
| pushd tools/cross/rootfs/arm | |
| ln -sf usr/lib lib | |
| popd | |
| docker run --rm -u root -v "${PWD}:${PWD}" -w "${PWD}" -e CROSS_BUILD=1 -e TARGET_ARCH=armv7l one-test make -f Makefile.template | |
| build-android: | |
| needs: filtering | |
| if: github.repository_owner == 'Samsung' && needs.filtering.outputs.android == 'true' | |
| runs-on: one-x64-linux | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Build Docker Image | |
| run: | | |
| docker build --file infra/docker/android-sdk/Dockerfile --tag one-test . | |
| - name: Test onert build | |
| run: | | |
| docker run --rm -u root -v "${PWD}:${PWD}" -w "${PWD}" -e CROSS_BUILD=1 -e TARGET_OS=android -e BUILD_TYPE=release one-test make -f Makefile.template |