Skip to content

Fix submodule to point to main (#287) #1742

Fix submodule to point to main (#287)

Fix submodule to point to main (#287) #1742

Workflow file for this run

name: CI
# Events that trigger workflow
on:
# Runs on all pushes to branches
push:
# Runs on all PRs
pull_request:
# Runs every day at midnight UTC
schedule:
- cron: "0 0 * * *"
# Manual Dispatch
workflow_dispatch:
jobs:
prepare-test-matrices:
name: Prepare Test Matrices and Cache PDKs
runs-on: ubuntu-22.04
outputs:
design_matrix: ${{ steps.set-matrix.outputs.design_matrix }}
opdks_rev: ${{ steps.set-rev.outputs.opdks_rev }}
steps:
- uses: actions/checkout@v3
- name: Python Dependencies
run: |
python3 -m pip install -r ./requirements.txt
- name: Determine If Running Extended Test Set
run: |
export EVENT_NAME=${{ github.event_name }};
python3 ./.github/scripts/determine_test_set.py
- name: Set Matrix
id: set-matrix
run: |
python3 ./.github/test_sets/get_test_matrix.py --scl sky130A/sky130_fd_sc_hd --scl gf180mcuD/gf180mcu_fd_sc_mcu7t5v0 $TEST_SETS
echo "design_matrix=$(python3 ./.github/test_sets/get_test_matrix.py --scl sky130A/sky130_fd_sc_hd --scl gf180mcuD/gf180mcu_fd_sc_mcu7t5v0 $TEST_SETS)" >> $GITHUB_OUTPUT
- name: Get Open PDKs Revision
id: set-rev
run: |
echo "opdks_rev=$(cat ./openlane/open_pdks_rev)" >> $GITHUB_OUTPUT
- name: Cache PDKs
uses: actions/cache@v3
with:
path: ~/.volare
key: cache-pdks-${{ steps.set-rev.outputs.opdks_rev }}
- name: Enable PDKs
run: |
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
volare enable --pdk sky130 ${{ steps.set-rev.outputs.opdks_rev }}
volare enable --pdk gf180mcu ${{ steps.set-rev.outputs.opdks_rev }}
lint:
name: Lint
runs-on: ubuntu-22.04
steps:
- name: Check out repo
uses: actions/checkout@v3
- name: Set Up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install Linters
run: make venv
- name: Lint
run: make lint
build-linux-amd64:
needs: lint
runs-on: ubuntu-22.04
name: Build (Nix on Linux/amd64)
steps:
- uses: actions/checkout@v3
- name: Initialize Step Unit Test Submodule
run: |
git submodule update --init test/steps/all
- name: Set up GITHUB_TOKEN
run: |
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
- name: Build with Nix
uses: ./.github/actions/build_nix
with:
cachix_cache: ${{ vars.CACHIX_CACHE || 'openlane' }}
cachix_token: "${{ secrets.CACHIX_TOKEN }}"
- name: Derivation to Cache
uses: ./.github/actions/derivation_to_cache
with:
key: derivation-amd64-${{ github.run_id }}
build-linux-aarch64:
needs: lint
runs-on: ubuntu-22.04
name: Build (Nix on Linux/aarch64)
steps:
- uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v1
- name: Initialize Step Unit Test Submodule
run: |
git submodule update --init test/steps/all
- name: Set up GITHUB_TOKEN
run: |
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
- name: Build with Nix
uses: ./.github/actions/build_nix
with:
cachix_cache: ${{ vars.CACHIX_CACHE || 'openlane' }}
cachix_token: "${{ secrets.CACHIX_TOKEN }}"
nix_build_args: --option system aarch64-linux --extra-platforms aarch64-linux
- name: Derivation to Cache
uses: ./.github/actions/derivation_to_cache
with:
key: derivation-aarch64-${{ github.run_id }}
build-mac-amd64:
needs: lint
runs-on: macos-12
name: Build (Nix on macOS/amd64)
steps:
- uses: actions/checkout@v3
- name: Initialize Step Unit Test Submodule
run: |
git submodule update --init test/steps/all
- name: Set up GITHUB_TOKEN
run: |
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
- name: Build with Nix
uses: ./.github/actions/build_nix
with:
cachix_cache: ${{ vars.CACHIX_CACHE || 'openlane' }}
cachix_token: "${{ secrets.CACHIX_TOKEN }}"
shell: "zsh {0}"
build-py:
runs-on: ubuntu-22.04
needs: lint
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
fail-fast: false
name: Build and Unit Test (Python ${{ matrix.python-version }})
steps:
- name: Check out repo
uses: actions/checkout@v3
- name: Set Up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Run Unit Tests
run: |
make test
build-docker:
runs-on: ubuntu-22.04
strategy:
matrix:
arch: ["amd64", "aarch64"]
needs: [build-linux-amd64, build-linux-aarch64]
name: Build Docker Image (${{ matrix.arch }})
steps:
- name: Check out repo
uses: actions/checkout@v3
- uses: docker/setup-qemu-action@v1
- name: Setup Nix
uses: ./.github/actions/setup_nix
with:
cachix_cache: ${{ vars.CACHIX_CACHE || 'openlane' }}
- name: Derivation from Cache
uses: ./.github/actions/derivation_from_cache
with:
key: derivation-${{ matrix.arch }}-${{ github.run_id }}
other-substituters: "https://${{ vars.CACHIX_CACHE || 'openlane' }}.cachix.org"
- name: Build Docker Image
run: |
if [ "${{ matrix.arch }}" == "aarch64" ]; then
arch_flags="--option system aarch64-linux --extra-platforms aarch64-linux"
fi
IMAGE_PATH=$(nix-build --argstr name openlane --argstr tag-override tmp-${{ matrix.arch }} $arch_flags docker.nix)
echo "IMAGE_PATH=$IMAGE_PATH" >> $GITHUB_ENV
cat $IMAGE_PATH | docker load
- name: Set Up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install Dependencies
run: make venv
- name: Smoke-Test Docker Image
run: |
mkdir -p $HOME/.volare
chmod -R 755 $HOME/.volare
OPENLANE_IMAGE_OVERRIDE=openlane:tmp-${{ matrix.arch }}\
./venv/bin/python3 -m openlane\
--docker-no-tty\
--dockerized\
--smoke-test
- name: Upload Docker Artifact
uses: actions/upload-artifact@v3
with:
name: docker-image-${{ matrix.arch }}
path: ${{ env.IMAGE_PATH }}
test:
runs-on: ubuntu-22.04
needs: [build-linux-amd64, prepare-test-matrices]
name: Test Design ${{ matrix.design.name }} (${{ matrix.design.pdk }}/${{matrix.design.scl}})
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.prepare-test-matrices.outputs.design_matrix) }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Setup Nix
uses: ./.github/actions/setup_nix
with:
cachix_cache: ${{ vars.CACHIX_CACHE || 'openlane' }}
- name: Derivation from Cache
uses: ./.github/actions/derivation_from_cache
with:
key: derivation-amd64-${{ github.run_id }}
other-substituters: "https://${{ vars.CACHIX_CACHE || 'openlane' }}.cachix.org"
- name: Cache PDKs
id: cache-pdks
uses: actions/cache@v3
with:
path: ~/.volare
key: cache-pdks-${{ needs.prepare-test-matrices.outputs.opdks_rev }}
- name: Enable PDKs
if: steps.cache-pdks.outputs.cache-hit != 'true'
run: |
pip3 install -r ./requirements.txt
volare enable --pdk sky130 ${{ needs.prepare-test-matrices.outputs.opdks_rev }}
volare enable --pdk gf180mcu ${{ needs.prepare-test-matrices.outputs.opdks_rev }}
- name: Run Test
run: |
nix-shell --run "\
python3 -m openlane\
--run-tag CI\
--pdk ${{ matrix.design.pdk }}\
--scl ${{matrix.design.scl}}\
${{ matrix.design.config }}\
"
- name: Upload Run Folder
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.design.name }}-${{ matrix.design.pdk }}-${{ matrix.design.scl }}
path: ${{ matrix.design.run_folder }}
publish:
runs-on: ubuntu-22.04
needs: [build-linux-amd64, build-mac-amd64, build-docker, build-py]
name: Publish (If Applicable)
steps:
- name: Check out repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Environment
uses: ./.github/actions/setup_env
- name: Auth (Docker)
if: ${{ env.PUBLISH == '1' }}
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GH_TOKEN }}
- name: Download Image (Docker/amd64)
uses: actions/download-artifact@v3
with:
name: docker-image-amd64
path: /tmp/docker
- name: Download Image (Docker/aarch64)
uses: actions/download-artifact@v3
with:
name: docker-image-aarch64
path: /tmp/docker
- name: Load Image (Docker)
run: |
cat /tmp/docker/* | docker load
- name: Push (Docker)
if: ${{ env.PUBLISH == '1' }}
run: |
docker tag openlane:tmp-amd64 ghcr.io/${{ github.repository }}:$NEW_TAG-amd64
docker push ghcr.io/${{ github.repository }}:$NEW_TAG-amd64
docker tag openlane:tmp-aarch64 ghcr.io/${{ github.repository }}:$NEW_TAG-aarch64
docker push ghcr.io/${{ github.repository }}:$NEW_TAG-aarch64
docker manifest create\
ghcr.io/${{ github.repository }}:$NEW_TAG\
ghcr.io/${{ github.repository }}:$NEW_TAG-amd64\
ghcr.io/${{ github.repository }}:$NEW_TAG-aarch64
docker push ghcr.io/${{ github.repository }}:$NEW_TAG
- name: Set Up Python
if: ${{ env.PUBLISH == '1' }}
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Build Distribution
if: ${{ env.PUBLISH == '1' }}
run: |
make dist
- name: Publish
if: ${{ env.PUBLISH == '1' }}
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Tag Commit
if: ${{ env.PUBLISH == '1' }}
uses: tvdias/github-tagger@v0.0.1
with:
tag: "${{ env.NEW_TAG }}"
repo-token: "${{ secrets.GH_TOKEN }}"