Skip to content

Allow manual triggering with a specific environment #8

Allow manual triggering with a specific environment

Allow manual triggering with a specific environment #8

Workflow file for this run

name: Reusable workflow to test everything in chipflow-examples works

Check failure on line 1 in .github/workflows/test-examples.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/test-examples.yml

Invalid workflow file

(Line: 17, Col: 15): Unexpected value 'environment'
on:
workflow_call:
secrets:
CHIPFLOW_API_KEY:
required: true
inputs:
CHIPFLOW_API_ORIGIN:
required: true
type: string
CHIPFLOW_BACKEND_VERSION:
required: true
type: string
ENVIRONMENT:
required: true
type: environment
jobs:
test-submit:
runs-on: ubuntu-latest
strategy:
matrix:
dry: [true, false]
repo:
- name: "ChipFlow/chipflow-examples"
design: "minimal"
env:
DRY: ${{ matrix.dry && '--dry-run' || '' }}
is_dry: ${{ matrix.dry && '(dry run)' || '' }}
our_path: ${{ github.workspace}}
test_repo_path: "${{ github.workspace }}/${{ matrix.repo.name }}"
name: ${{ matrix.dry && 'Test Submit - Dry run' || 'Test submit' }}
steps:
- name: Check out source code
uses: actions/checkout@v4
with:
path: ${{ env.our_path }}
- name: Check out ${{ matrix.repo.name }}
uses: actions/checkout@v4
with:
repository: ${{ matrix.repo.name }}
path: ${{ env.test_repo_path }}
- name: Check for branch ${{ github.head_ref }}
id: check-head-ref
working-directory: ${{ env.test_repo_path }}
if: github.event_name == 'pull_request'
env:
HEAD_REF: ${{ github.head_ref }}
BASE_REF: ${{ github.base_ref }}
run: |
git remote update
if git checkout $HEAD_REF; then
echo "Using branch $HEAD_REF"
echo "found-branch=1\n" >> $GITHUB_OUTPUT
else
echo "$HEAD_REF not found, checking base $BASE_REF"
echo "found-branch=0\n" >> $GITHUB_OUTPUT
fi
- name: Check for branch ${{ github.base_ref }}
id: check-base-ref
working-directory: ${{ env.test_repo_path }}x
if: github.event_name == 'pull_request' && steps.check-head-ref.outputs.found-branch == '0'
run: |
git remote update
if git checkout ${{ github.base_ref }}; then
echo "Using branch ${{github.base_ref}}"
echo "found-branch=1\n" >> $GITHUB_OUTPUT
else
|| echo "${{github.base_ref}} not found Falling back to main"
echo "found-branch=0\n" >> $GITHUB_OUTPUT
fi
- name: Set up PDM
uses: pdm-project/setup-pdm@v4
with:
python-version: '3.10'
cache: true
cache-dependency-path: './**/pyproject.toml'
- name: Install dependencies with multirepo
uses: chipflow/pdm-multirepo@v3
with:
working-directory: ${{ env.test_repo_path }}
- name: Run tests
working-directory: ${{ env.test_repo_path }}
run: |
pdm test
- name: Run simulation check
working-directory: ${{ env.test_repo_path }}/${{ matrix.repo.design }}
run: |
pdm run chipflow pin lock
pdm sim-check
- name: Submit build ${{ env.is_dry }}
working-directory: ${{ env.test_repo_path }}/${{ matrix.repo.design }}
run: |
set -o pipefail
pdm run chipflow silicon submit --wait $DRY | cat
env:
CHIPFLOW_API_KEY: ${{ secrets.CHIPFLOW_API_KEY}}
CHIPFLOW_API_ORIGIN: ${{ inputs.CHIPFLOW_API_ORIGIN }}
CHIPFLOW_BACKEND_VERSION: ${{ inputs.CHIPFLOW_BACKEND_VERSION }}