diff --git a/.github/workflows/precheck_test.yml b/.github/workflows/precheck_test.yml index c9685bb..d332746 100644 --- a/.github/workflows/precheck_test.yml +++ b/.github/workflows/precheck_test.yml @@ -12,67 +12,90 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - repo: ['caravel_user_project', 'caravel_user_mini', 'caravel_user_sram', 'caravel_user_project_analog', 'openframe_timer_example'] + repo: ['caravel_user_project','caravel_user_mini','caravel_user_sram','caravel_user_project_analog','openframe_timer_example'] + fail-fast: false # Allow other jobs to continue if one fails steps: - name: Checkout efabless/mpw_precheck - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: efabless/mpw_precheck path: mpw_precheck - name: Checkout ${{ matrix.repo }} - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: efabless/${{ matrix.repo }} path: ${{ matrix.repo }} - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 - - name: Build and push - uses: docker/build-push-action@v2 + - name: Cache Docker layers + uses: actions/cache@v3 with: - context: mpw_precheck/dependencies - file: mpw_precheck/dependencies/Dockerfile - push: false - load: true - tags: mpw_precheck:latest + path: /tmp/.buildx-cache + key: ${{ runner.os }}-buildx-${{ hashFiles('mpw_precheck/dependencies/Dockerfile') }} + restore-keys: | + ${{ runner.os }}-buildx- - - name: Install Volare + - name: Build Docker image + run: | + docker buildx create --use + docker buildx build \ + --cache-from=type=local,src=/tmp/.buildx-cache \ + --cache-to=type=local,dest=/tmp/.buildx-cache-new,mode=max \ + --output type=docker \ + --tag mpw_precheck:latest \ + mpw_precheck/dependencies + timeout-minutes: 15 + + - name: Move cache + run: | + rm -rf /tmp/.buildx-cache + mv /tmp/.buildx-cache-new /tmp/.buildx-cache + + - name: Cache PDK + id: cache-pdk + uses: actions/cache@v3 + with: + path: ${{ github.workspace }}/pdk + key: ${{ runner.os }}-pdk-${{ hashFiles('**/volare.toml') }} + + - name: Install Volare and PDK + if: steps.cache-pdk.outputs.cache-hit != 'true' 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 + volare enable --pdk sky130 --version latest + env: + PDK_ROOT: ${{ github.workspace }}/pdk - name: Run MPW Precheck run: | + mkdir -p ${{ github.workspace }}/mpw_precheck_output docker run --rm \ -v ${{ github.workspace }}/mpw_precheck:/mpw_precheck \ -v ${{ github.workspace }}/${{ matrix.repo }}:/project \ - -v ${{ env.PDK_ROOT }}:/pdk \ + -v ${{ github.workspace }}/pdk:/pdk \ + -v ${{ github.workspace }}/mpw_precheck_output:/output \ -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 }}/ + python3 /mpw_precheck/mpw_precheck.py --input_directory /project --pdk_root /pdk --output_directory /output + timeout-minutes: 30 - - name: Upload logs and outputs - uses: actions/upload-artifact@v2 + - name: Collect and upload logs and outputs + uses: actions/upload-artifact@v3 with: name: mpw-precheck-results-${{ matrix.repo }} - path: ${{ github.workspace }}/mpw_precheck_results/${{ matrix.repo }} + path: | + ${{ github.workspace }}/mpw_precheck_output + ${{ github.workspace }}/mpw_precheck/logs - 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 + if [ -f "${{ github.workspace }}/mpw_precheck_output/mpw_precheck_results.txt" ]; then + if grep -q "FAIL" "${{ github.workspace }}/mpw_precheck_output/mpw_precheck_results.txt"; then echo "MPW Precheck failed for ${{ matrix.repo }}" exit 1 else