Set up SVLint #36
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: risc-v CI | |
| on: | |
| pull_request: | |
| permissions: | |
| contents: read | |
| packages: write | |
| jobs: | |
| build_ci_image: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| image-tag: ${{ steps.meta.outputs.tags }} | |
| image-digest: ${{ steps.build.outputs.digest }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ghcr.io/utoss/risc-v | |
| tags: | | |
| type=ref,event=branch,prefix=ci-branch- | |
| type=ref,event=pr,prefix=ci-pr- | |
| type=raw,value=latest,prefix=ci-,enable={{is_default_branch}} | |
| - name: Build and push Docker image | |
| id: build | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./Dockerfile.ci | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| platforms: linux/amd64 | |
| cache-from: | | |
| type=gha | |
| type=registry,ref=ghcr.io/utoss/risc-v:buildcache | |
| cache-to: | | |
| type=gha,mode=max | |
| type=registry,ref=ghcr.io/utoss/risc-v:buildcache,mode=max | |
| svlint: | |
| needs: build_ci_image | |
| runs-on: ubuntu-latest | |
| continue-on-error: true | |
| container: | |
| image: ${{ needs.build_ci_image.outputs.image-tag }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: lint sources | |
| run: make svlint; | |
| - name: lint testbench | |
| run: make svlint_tb; | |
| build_and_test: | |
| needs: build_ci_image | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ${{ needs.build_ci_image.outputs.image-tag }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Build top | |
| id: build-top | |
| run: make build_top | |
| - name: Build testbench | |
| id: build-testbench | |
| run: make build_tb | |
| - name: Run testbench | |
| run: make run_tb | |
| - name: Upload VCD files | |
| uses: actions/upload-artifact@v4 | |
| if: steps.build-testbench.outcome == 'success' | |
| with: | |
| name: vcd-files | |
| path: test/vcd/*.vcd | |
| retention-days: 7 | |
| - name: Upload VVP files | |
| uses: actions/upload-artifact@v4 | |
| if: steps.build-top.outcome == 'success' | |
| with: | |
| name: vvp-files | |
| path: out/*.vvp | |
| retention-days: 7 |