Skip to content
Merged
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
31 changes: 24 additions & 7 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
- 'latest-release'
pull_request:
merge_group:
repository_dispatch:
types: [backend-test]
workflow_dispatch:
inputs:
release:
Expand All @@ -14,12 +16,17 @@ on:
ENVIRONMENT:
required: true
type: environment
backend_version:
description: 'Backend version/tag to test against (overrides vars.CHIPFLOW_BACKEND_VERSION)'
required: false
type: string

env:
lock_pdm: ${{ ! (github.ref_name == 'refs/heads/latest-release' || inputs.release) }}
BACKEND_VERSION: ${{ inputs.backend_version || github.event.client_payload.backend_version || vars.CHIPFLOW_BACKEND_VERSION }}

name: CI
run-name: ${{ inputs.release && 'Release' || 'CI'}}
run-name: ${{ github.event_name == 'repository_dispatch' && format('Backend Test - {0}', github.event.client_payload.backend_version) || (inputs.backend_version && format('CI - Backend {0}', inputs.backend_version) || (inputs.release && 'Release' || 'CI')) }}
jobs:

submit:
Expand All @@ -31,7 +38,7 @@ jobs:
- name: Check out source code
uses: actions/checkout@v4

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5

- name: Set up PDM
uses: pdm-project/setup-pdm@v4
Expand All @@ -43,6 +50,15 @@ jobs:
- name: Install dependencies with multirepo
uses: chipflow/pdm-multirepo@v1

- name: Cache ~/.cache directory
uses: actions/cache@v4
with:
path: ~/.cache
key: cache-${{ runner.os }}-${{ matrix.design }}-${{ hashFiles('**/pyproject.toml', '**/pdm.lock') }}
restore-keys: |
cache-${{ runner.os }}-${{ matrix.design }}-
cache-${{ runner.os }}-

- name: Lock pins
working-directory: ./${{ matrix.design }}
run: pdm run chipflow pin lock
Expand All @@ -53,7 +69,7 @@ jobs:
env:
CHIPFLOW_API_KEY: ${{ secrets.CHIPFLOW_API_KEY}}
CHIPFLOW_API_ORIGIN: ${{ vars.CHIPFLOW_API_ORIGIN }}
CHIPFLOW_BACKEND_VERSION: ${{ vars.CHIPFLOW_BACKEND_VERSION }}
CHIPFLOW_BACKEND_VERSION: ${{ env.BACKEND_VERSION }}

test:
runs-on: ubuntu-latest
Expand All @@ -74,13 +90,14 @@ jobs:
- name: Install dependencies with multirepo
uses: chipflow/pdm-multirepo@v1

- name: Cache YoWASP build products
- name: Cache ~/.cache directory
uses: actions/cache@v4
with:
path: ~/.cache/YoWASP
key: YoWASP-${{ runner.os }}-${{ hashFiles('./.venv/**/*.wasm') }}
path: ~/.cache
key: cache-${{ runner.os }}-${{ matrix.design }}-${{ hashFiles('**/pyproject.toml', '**/pdm.lock') }}
restore-keys: |
YoWASP-${{ runner.os }}-
cache-${{ runner.os }}-${{ matrix.design }}-
cache-${{ runner.os }}-

- name: Lock pins
working-directory: ./${{ matrix.design }}
Expand Down
Loading