name: aws
on:
  push:
    branches:
      - 'dev'

jobs:
  aws:
    name: AWS Pipeline (private)
    if: ${{ (github.actor == 'davideschiavone' || github.actor == 'MikeOpenHWGroup' || github.actor == 'zarubaf') && github.event.label.name != 'Component:Doc' }}
    runs-on: ubuntu-latest
    # These permissions are needed to interact with GitHub's OIDC Token endpoint.
    permissions:
      id-token: write
      contents: read
    steps:
      - name: Configure AWS Credentials
        uses: aws-actions/configure-aws-credentials@v1
        with:
          role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
          aws-region: eu-west-1
      - name: Run AWS Pipeline
        uses: openhwgroup/aws-codebuild-run-build@master
        with:
          project-name: cv32e40p
          hide-log: true
  skip_aws:
    name: no AWS
    if: ${{ (github.actor == 'davideschiavone' || github.actor == 'MikeOpenHWGroup' || github.actor == 'zarubaf') && github.event.label.name == 'Component:Doc' }}
    runs-on: ubuntu-latest
    steps:
      - name: info
        run: echo "Documentation only, skipping LEC on AWS"
