Skip to content

Commit

Permalink
Create precheck_test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
marwaneltoukhy authored Sep 2, 2024
1 parent 75f9de2 commit 58cdc2a
Showing 1 changed file with 84 additions and 0 deletions.
84 changes: 84 additions & 0 deletions .github/workflows/precheck_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: MPW Precheck

on:
# Runs on Every Push
push:
# Runs on Pull Requests
pull_request:
workflow_dispatch:

jobs:
mpw-precheck:
runs-on: ubuntu-latest
strategy:
matrix:
repo: ['caravel_user_project', 'caravel_user_mini', 'caravel_user_sram', 'caravel_user_project_analog', 'openframe_timer_example']

steps:
- name: Checkout efabless/mpw_precheck
uses: actions/checkout@v2
with:
repository: efabless/mpw_precheck
path: mpw_precheck

- name: Checkout ${{ matrix.repo }}
uses: actions/checkout@v2
with:
repository: efabless/${{ matrix.repo }}
path: ${{ matrix.repo }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build and push
uses: docker/build-push-action@v2
with:
context: mpw_precheck/dependencies
file: mpw_precheck/dependencies/Dockerfile
push: false
load: true
tags: mpw_precheck:latest

- name: Install Volare
run: |
python3 -m pip install --upgrade --no-cache-dir volare
mkdir -p ${{ github.workspace }}/pdk
volare enable --pdk sky130 --version 6d4d11780c40b20ee63cc98e645307a9bf2b2ab8
echo "PDK_ROOT=${{ github.workspace }}/pdk" >> $GITHUB_ENV
- name: Run MPW Precheck
run: |
docker run --rm \
-v ${{ github.workspace }}/mpw_precheck:/mpw_precheck \
-v ${{ github.workspace }}/${{ matrix.repo }}:/project \
-v ${{ env.PDK_ROOT }}:/pdk \
-e PDK_ROOT=/pdk \
mpw_precheck:latest \
python3 /mpw_precheck/mpw_precheck.py --input_directory /project --pdk_root /pdk
- name: Collect logs and outputs
run: |
mkdir -p ${{ github.workspace }}/mpw_precheck_results/${{ matrix.repo }}
cp -r ${{ github.workspace }}/mpw_precheck_output/* ${{ github.workspace }}/mpw_precheck_results/${{ matrix.repo }}/
cp -r ${{ github.workspace }}/mpw_precheck/logs ${{ github.workspace }}/mpw_precheck_results/${{ matrix.repo }}/
- name: Upload logs and outputs
uses: actions/upload-artifact@v2
with:
name: mpw-precheck-results-${{ matrix.repo }}
path: ${{ github.workspace }}/mpw_precheck_results/${{ matrix.repo }}

- name: Check for failures
run: |
if [ -f "${{ github.workspace }}/mpw_precheck_results/${{ matrix.repo }}/mpw_precheck_results.txt" ]; then
if grep -q "FAIL" "${{ github.workspace }}/mpw_precheck_results/${{ matrix.repo }}/mpw_precheck_results.txt"; then
echo "MPW Precheck failed for ${{ matrix.repo }}"
exit 1
else
echo "MPW Precheck passed for ${{ matrix.repo }}"
fi
else
echo "Results file not found for ${{ matrix.repo }}"
exit 1
fi

0 comments on commit 58cdc2a

Please sign in to comment.