Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

on:
push:
branches:
Expand All @@ -6,11 +7,18 @@ on:
merge_group:
schedule:
- cron: '0 0 * * *' # Every day at midnight UTC

# allow manual triggering with a given environment
workflow_dispatch:
inputs:
ENVIRONMENT:
required: true
type: environment
name: CI
jobs:

test:
environment:
name: ${{ vars.ENVIRONMENT }}
runs-on: ubuntu-latest
steps:
- name: Check out source code
Expand All @@ -34,6 +42,8 @@ jobs:
run: pdm run test-docs

license:
environment:
name: ${{ vars.ENVIRONMENT}}
runs-on: ubuntu-latest
steps:
- name: Check out source code
Expand All @@ -45,5 +55,10 @@ jobs:

test-submit:
uses: ./.github/workflows/test-examples.yml
with:
CHIPFLOW_API_ORIGIN: ${{ vars.CHIPFLOW_API_ORIGIN }}
CHIPFLOW_BACKEND_VERSION: ${{ vars.CHIPFLOW_BACKEND_VERSION }}
ENVIRONMENT: ${{ vars.ENVIRONMENT }}
secrets:
CHIPFLOW_API_KEY: ${{ secrets.CHIPFLOW_API_KEY}}

27 changes: 22 additions & 5 deletions .github/workflows/test-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,22 @@ on:
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: string


jobs:
test-submit:
runs-on: ubuntu-latest
environment: ${{ vars.ENVIRONMENT }}
strategy:
matrix:
dry: [true, false]
Expand All @@ -18,7 +30,7 @@ jobs:
env:
DRY: ${{ matrix.dry && '--dry-run' || '' }}
is_dry: ${{ matrix.dry && '(dry run)' || '' }}
our_path: "${{ github.workspace}}/${{ github.repo }}"
our_path: ${{ github.workspace}}
test_repo_path: "${{ github.workspace }}/${{ matrix.repo.name }}"

name: ${{ matrix.dry && 'Test Submit - Dry run' || 'Test submit' }}
Expand All @@ -39,20 +51,23 @@ jobs:
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 ${{ github.head_ref }}; then
echo "Using branch ${{github.head_ref}}"
if git checkout $HEAD_REF; then
echo "Using branch $HEAD_REF"
echo "found-branch=1\n" >> $GITHUB_OUTPUT
else
echo "${{github.head_ref}} not found, checking base ${{github.base_ref}}"
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 == 0
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
Expand Down Expand Up @@ -92,3 +107,5 @@ jobs:
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 }}
Loading