diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml new file mode 100644 index 0000000..6c5b60e --- /dev/null +++ b/.github/workflows/cicd.yml @@ -0,0 +1,129 @@ +# SPDX-FileCopyrightText: Copyright (c) 2025 Advanced Micro Devices, Inc. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2025 Timor Knudsen (AMD) + +# SPDX-License-Identifier: MIT + +name: "Lint, simulate, synthesize, test and docs" + +on: [push] + +jobs: + lint: + name: "Run pre-commit lint" + runs-on: ubuntu-latest + container: + image: ghcr.io/amd/mini-isp-dev:latest + options: --user root + credentials: + username: ${{ github.actor }} + password: ${{ secrets.github_token }} + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + - name: Run lint + run: | + git config --global --add safe.directory $GITHUB_WORKSPACE + make lint + + simulation: + name: "Run test bench simulations" + runs-on: ubuntu-latest + container: + image: ghcr.io/amd/mini-isp-dev:latest + options: --user root + credentials: + username: ${{ github.actor }} + password: ${{ secrets.github_token }} + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + - name: Simulation + run: make sim + - name: Upload + uses: actions/upload-artifact@v7 + with: + name: Simulation artifacts + path: | + build/sim/**/*.png + build/sim/**/*.pdf + build/sim/**/*.xml + retention-days: 1 + + synthesis: + name: "Run synthesis and generate reports" + runs-on: ubuntu-latest + container: + image: ghcr.io/amd/mini-isp-dev:latest + options: --user root + credentials: + username: ${{ github.actor }} + password: ${{ secrets.github_token }} + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + - name: Synthesis + run: make synth + - name: Upload + uses: actions/upload-artifact@v7 + with: + name: synthesis_reports + path: build/docs/reports + retention-days: 1 + + test: + name: "Run Python tests" + runs-on: ubuntu-latest + container: + image: ghcr.io/amd/mini-isp-dev:latest + options: --user root + credentials: + username: ${{ github.actor }} + password: ${{ secrets.github_token }} + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + - name: Test + run: make test + + docs: + name: "Generate documentation" + needs: synthesis + permissions: + contents: read + packages: write + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + container: + image: ghcr.io/amd/mini-isp-dev:latest + options: --user root + credentials: + username: ${{ github.actor }} + password: ${{ secrets.github_token }} + if: ${{ github.ref == 'ref/head/main' }} + steps: + - uses: actions/configure-pages@v5 + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + - uses: actions/download-artifact@v8 + with: + name: synthesis_reports + path: build/docs/reports + - run: make docs + - uses: actions/upload-pages-artifact@v4 + with: + path: build/site + - uses: actions/deploy-pages@v4 + id: deployment diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index 63cb575..6e981ea 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -33,7 +33,7 @@ jobs: fetch-depth: 0 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@v4 - name: Lint Dockerfile uses: hadolint/hadolint-action@v3.1.0 @@ -49,9 +49,6 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v4 - - name: Build base container image uses: docker/build-push-action@v7 with: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index 52b0e53..0000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,68 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 Advanced Micro Devices, Inc. All rights reserved. -# SPDX-FileCopyrightText: Copyright (c) 2025 Timor Knudsen (AMD) - -# SPDX-License-Identifier: MIT - -name: Documentation -on: - push: - branches: - - main - -permissions: - contents: read - pages: write - id-token: write - -jobs: - synthesis_reports: - name: "Generate synthesis reports" - runs-on: ubuntu-latest - container: - image: ghcr.io/amd/mini-isp-dev:latest - options: --user root - credentials: - username: ${{ github.actor }} - password: ${{ secrets.github_token }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Synthesis - run: uv run pytest -m "synth" --speed default - - name: Upload - uses: actions/upload-artifact@v4 - with: - name: synthesis_reports - path: build/docs/reports - retention-days: 1 - - deploy: - name: "Generate documentation" - needs: synthesis_reports - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - container: - image: ghcr.io/amd/mini-isp-dev:latest - options: --user root - credentials: - username: ${{ github.actor }} - password: ${{ secrets.github_token }} - steps: - - uses: actions/configure-pages@v3 - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: actions/download-artifact@v3 - with: - name: synthesis_reports - path: build/docs/reports - - run: make docs - - uses: actions/upload-pages-artifact@v2 - with: - path: build/site - - uses: actions/deploy-pages@v3 - id: deployment diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml deleted file mode 100644 index 0bd0b99..0000000 --- a/.github/workflows/lint.yml +++ /dev/null @@ -1,26 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 Advanced Micro Devices, Inc. All rights reserved. -# SPDX-FileCopyrightText: Copyright (c) 2025 Timor Knudsen (AMD) - -# SPDX-License-Identifier: MIT - -name: Linting and license check - -on: [push] - -jobs: - pre-commit: - name: "Run pre-commit lint" - runs-on: ubuntu-latest - container: - image: ghcr.io/amd/mini-isp-dev:latest - options: --user root - credentials: - username: ${{ github.actor }} - password: ${{ secrets.github_token }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Run lint - run: make lint diff --git a/.github/workflows/simulation.yml b/.github/workflows/simulation.yml deleted file mode 100644 index 15e8dc6..0000000 --- a/.github/workflows/simulation.yml +++ /dev/null @@ -1,35 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 Advanced Micro Devices, Inc. All rights reserved. -# SPDX-FileCopyrightText: Copyright (c) 2025 Timor Knudsen (AMD) - -# SPDX-License-Identifier: MIT - -name: Simulation - -on: [push] - -jobs: - build: - name: "Run test bench simulations" - runs-on: ubuntu-latest - container: - image: ghcr.io/amd/mini-isp-dev:latest - options: --user root - credentials: - username: ${{ github.actor }} - password: ${{ secrets.github_token }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Simulation - run: make sim - - name: Upload - uses: actions/upload-artifact@v4 - with: - name: Simulation artifacts - path: | - build/sim/**/*.png - build/sim/**/*.pdf - build/sim/**/*.xml - retention-days: 1 diff --git a/.github/workflows/synthesis.yml b/.github/workflows/synthesis.yml deleted file mode 100644 index 5df947b..0000000 --- a/.github/workflows/synthesis.yml +++ /dev/null @@ -1,26 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 Advanced Micro Devices, Inc. All rights reserved. -# SPDX-FileCopyrightText: Copyright (c) 2025 Timor Knudsen (AMD) - -# SPDX-License-Identifier: MIT - -name: Synthesis - -on: [push] - -jobs: - build: - name: "Run synthesis and generate reports" - runs-on: ubuntu-latest - container: - image: ghcr.io/amd/mini-isp-dev:latest - options: --user root - credentials: - username: ${{ github.actor }} - password: ${{ secrets.github_token }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Synthesis - run: make synth diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 4f4ed23..0000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,26 +0,0 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025 Advanced Micro Devices, Inc. All rights reserved. -# SPDX-FileCopyrightText: Copyright (c) 2025 Timor Knudsen (AMD) - -# SPDX-License-Identifier: MIT - -name: Test - -on: [push] - -jobs: - build: - name: "Run Python tests" - runs-on: ubuntu-latest - container: - image: ghcr.io/amd/mini-isp-dev:latest - options: --user root - credentials: - username: ${{ github.actor }} - password: ${{ secrets.github_token }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Test - run: make test