conf,ci: Transition to KAS for build and workflow management #8
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 and Test | |
| on: | |
| pull_request: | |
| schedule: | |
| # Runs at 3:00 AM UTC every day | |
| - cron: '0 3 * * *' | |
| workflow_dispatch: | |
| inputs: | |
| machine: | |
| description: 'Select machine' | |
| required: true | |
| type: choice | |
| options: | |
| - raspberrypi3-mesa | |
| - raspberrypi4-64-mesa | |
| - raspberrypi5 | |
| - wandboard-mesa | |
| wpe_version: | |
| description: 'Select WPEWebKit version' | |
| required: true | |
| type: choice | |
| options: | |
| - '2_50' | |
| - nightly | |
| jobs: | |
| timestamp: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: ./.github/actions/timestamp | |
| define-matrix: | |
| runs-on: ubuntu-22.04 | |
| outputs: | |
| machine: ${{ steps.define.outputs.machines }} | |
| wpe_version: ${{ steps.define.outputs.wpe_version }} | |
| steps: | |
| - name: Define matrix values | |
| id: define | |
| run: | | |
| if [ "${{ github.event_name }}" == "pull_request" ] && [ "${{ github.event.pull_request.draft }}" == "true" ]; then | |
| echo 'machines=["raspberrypi5"]' >> $GITHUB_OUTPUT | |
| elif [ "${{ github.event_name }}" == "pull_request" ]; then | |
| echo 'machines=["raspberrypi3-mesa", "raspberrypi4-64-mesa", "raspberrypi5", "wandboard-mesa"]' >> $GITHUB_OUTPUT | |
| elif [ -n "${{ github.event.inputs.machine }}" ]; then | |
| echo "machines=[\"${{ github.event.inputs.machine }}\"]" >> $GITHUB_OUTPUT | |
| else | |
| echo 'machines=["raspberrypi3-mesa", "raspberrypi5"]' >> $GITHUB_OUTPUT | |
| fi | |
| if [ "${{ github.event_name }}" == "pull_request" ]; then | |
| echo 'wpe_version=["2_50"]' >> $GITHUB_OUTPUT | |
| elif [ -n "${{ github.event.inputs.wpe_version }}" ]; then | |
| echo "wpe_version=[\"${{ github.event.inputs.wpe_version }}\"]" >> $GITHUB_OUTPUT | |
| else | |
| echo 'wpe_version=["nightly"]' >> $GITHUB_OUTPUT | |
| fi | |
| scarthgap-repo-init: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| machine: ${{ fromJSON(needs.define-matrix.outputs.machine) }} | |
| wpe_version: ${{ fromJSON(needs.define-matrix.outputs.wpe_version) }} | |
| yocto_rel: ['scarthgap'] | |
| continue-on-error: true | |
| runs-on: ubuntu-22.04 | |
| needs: [define-matrix] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: ./.github/actions/kas-checkout | |
| with: | |
| machine: ${{ matrix.machine }} | |
| repo_release: ${{ matrix.yocto_rel }} | |
| wpe_version: ${{ matrix.wpe_version }} | |
| buildhistory-collect-srcrevs: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| machine: ${{ fromJSON(needs.define-matrix.outputs.machine) }} | |
| wpe_version: ${{ fromJSON(needs.define-matrix.outputs.wpe_version) }} | |
| yocto_rel: ['scarthgap'] | |
| continue-on-error: true | |
| runs-on: [self-hosted, builder] | |
| needs: [define-matrix, scarthgap-repo-init, timestamp] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: ./.github/actions/s3-configure | |
| env: | |
| S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} | |
| S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }} | |
| S3_HOST_BASE: ${{ secrets.S3_HOST_BASE }} | |
| with: | |
| access_key: ${S3_ACCESS_KEY} | |
| secret_key: ${S3_SECRET_KEY} | |
| host_base: ${S3_HOST_BASE} | |
| - uses: ./.github/actions/buildhistory-collect-srcrevs | |
| env: | |
| S3_STORAGE: ${{ secrets.S3_STORAGE }} | |
| with: | |
| machine: ${{ matrix.machine }} | |
| repo_release: ${{ matrix.yocto_rel }} | |
| s3_storage: ${S3_STORAGE} | |
| wpe_version: ${{ matrix.wpe_version }} | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| machine: ${{ fromJSON(needs.define-matrix.outputs.machine) }} | |
| wpe_version: ${{ fromJSON(needs.define-matrix.outputs.wpe_version) }} | |
| yocto_rel: ['scarthgap'] | |
| continue-on-error: true | |
| runs-on: [self-hosted, builder] | |
| needs: [define-matrix, scarthgap-repo-init] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: ./.github/actions/s3-configure | |
| env: | |
| S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} | |
| S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }} | |
| S3_HOST_BASE: ${{ secrets.S3_HOST_BASE }} | |
| with: | |
| access_key: ${S3_ACCESS_KEY} | |
| secret_key: ${S3_SECRET_KEY} | |
| host_base: ${S3_HOST_BASE} | |
| - uses: ./.github/actions/kas-build | |
| env: | |
| S3_STORAGE: ${{ secrets.S3_STORAGE }} | |
| with: | |
| machine: ${{ matrix.machine }} | |
| repo_release: ${{ matrix.yocto_rel }} | |
| s3_storage: ${S3_STORAGE} | |
| wpe_version: ${{ fromJSON(needs.define-matrix.outputs.wpe_version) }} | |
| test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| machine: ${{ fromJSON(needs.define-matrix.outputs.machine) }} | |
| wpe_version: ${{ fromJSON(needs.define-matrix.outputs.wpe_version) }} | |
| yocto_rel: ['scarthgap'] | |
| runs-on: [self-hosted, podman] | |
| permissions: | |
| pull-requests: write | |
| needs: [define-matrix, build] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: ./.github/actions/s3-configure | |
| env: | |
| S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} | |
| S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }} | |
| S3_HOST_BASE: ${{ secrets.S3_HOST_BASE }} | |
| with: | |
| access_key: ${S3_ACCESS_KEY} | |
| secret_key: ${S3_SECRET_KEY} | |
| host_base: ${S3_HOST_BASE} | |
| - uses: ./.github/actions/podman-robot | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.github_token }} | |
| S3_STORAGE: ${{ secrets.S3_STORAGE }} | |
| with: | |
| machine: ${{ matrix.machine }} | |
| github_token: ${GITHUB_TOKEN} | |
| s3_storage: ${S3_STORAGE} | |
| wpe_version: ${{ matrix.wpe_version }} |