Skip to content

Commit

Permalink
ci: Update after snitch_cluster#192
Browse files Browse the repository at this point in the history
  • Loading branch information
colluca committed Oct 3, 2024
1 parent d8082cf commit 8260590
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 63 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/build-docker.yml

This file was deleted.

75 changes: 71 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,102 @@ name: ci
on: [push, pull_request]
jobs:

##########################
# Build Docker Container #
##########################

build-docker:
name: Deploy Docker image
runs-on: ubuntu-22.04
if: >
github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name != github.repository
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- name: GHCR Log-in
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max`
file: util/container/Dockerfile
push: true
tags: ghcr.io/pulp-platform/occamy:${{ github.ref_name }}
build-args: |-
SNITCH_LLVM_VERSION=latest
########
# Docs #
########

docs:
name: Build documentation
runs-on: ubuntu-22.04
needs: build-docker
if: >
github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name != github.repository
container:
image: ghcr.io/pulp-platform/occamy:main
image: ghcr.io/pulp-platform/occamy:${{ github.ref_name }}
steps:
- uses: actions/checkout@v2
- name: Build docs
run: |
bender checkout
mkdocs build
######################
# Clang-Format Check #
######################

clangfmt:
name: Lint C/C++ Sources
runs-on: ubuntu-22.04
needs: build-docker
if: >
github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name != github.repository
container:
image: ghcr.io/pulp-platform/occamy:${{ github.ref_name }}
steps:
- name: Check out source repository
uses: actions/checkout@v2
# Re-use .clang-format from Snitch cluster
- name: Get snitch_cluster dependency
run: |
bender checkout
- name: Lint C sources
uses: DoozyX/clang-format-lint-action@v0.16.2
with:
clangFormatVersion: 10

#######################
# Build SW for Occamy #
#######################

occamy-sw:
name: Build SW for Occamy
runs-on: ubuntu-22.04
needs: build-docker
if: >
github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name != github.repository
container:
image: ghcr.io/pulp-platform/occamy:main
image: ghcr.io/pulp-platform/occamy:${{ github.ref_name }}
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Build Software
run: |
bender checkout
pip install deps/snitch_cluster
make -C target/sim sw
###############################
Expand All @@ -49,8 +112,12 @@ jobs:
occamy-rtl:
name: Generate Occamy RTL sources
runs-on: ubuntu-22.04
needs: build-docker
if: >
github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name != github.repository
container:
image: ghcr.io/pulp-platform/occamy:main
image: ghcr.io/pulp-platform/occamy:${{ github.ref_name }}
steps:
- uses: actions/checkout@v2
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/gitlab-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
- name: Check Gitlab CI
uses: pulp-platform/pulp-actions/gitlab-ci@v2.1.0
# Skip on forks or pull requests from forks due to missing secrets.
if:
# yamllint disable rule:line-length
github.repository == 'pulp-platform/occamy' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
# yamllint enable rule:line-length
if: >
github.repository == 'pulp-platform/snitch_cluster' &&
(github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository)
with:
domain: iis-git.ee.ethz.ch
repo: github-mirror/occamy
Expand Down
48 changes: 25 additions & 23 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ jobs:
################
# Verible Lint #
################

verible-lint:
name: Lint Verilog sources
runs-on: ubuntu-latest
if: >
github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name != github.repository
steps:
- uses: actions/checkout@v3
- uses: chipsalliance/verible-linter-action@main
Expand All @@ -31,19 +35,27 @@ jobs:
#####################
# Vendor Up-to-Date #
#####################

bender-vendor-up-to-date:
name: Check bender vendor up-to-date
runs-on: ubuntu-latest
if: >
github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name != github.repository
steps:
- name: Check bender vendor up-to-date
uses: pulp-platform/pulp-actions/bender-vendor-up-to-date@v2.1.0

#################
# Check License #
#################

license-lint:
name: Check License headers
runs-on: ubuntu-latest
if: >
github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name != github.repository
steps:
- name: Check License
uses: pulp-platform/pulp-actions/lint-license@v2.1.0
Expand All @@ -67,9 +79,13 @@ jobs:
##################
# Lint YML Files #
##################

yaml-lint:
name: Lint YAML Sources
runs-on: ubuntu-latest
if: >
github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name != github.repository
steps:
- uses: actions/checkout@v3
- name: yaml-lint
Expand All @@ -80,9 +96,13 @@ jobs:
########################
# Check Python Sources #
########################

python-lint:
runs-on: ubuntu-latest
name: Lint Python Sources
runs-on: ubuntu-latest
if: >
github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name != github.repository
steps:
- name: Check out source repository
uses: actions/checkout@v3
Expand All @@ -95,34 +115,16 @@ jobs:
with:
max-line-length: "100"

######################
# Clang-Format Check #
######################
# Check C/C++ files for correct formatting.
clangfmt:
name: Lint C/C++ Sources
runs-on: ubuntu-latest
container:
image: ghcr.io/pulp-platform/occamy:main
steps:
- name: Check out source repository
uses: actions/checkout@v2
# Re-use .clang-format from Snitch cluster
- name: Get snitch_cluster dependency
run: |
bender update
- name: Lint C sources
uses: DoozyX/clang-format-lint-action@v0.16.2
with:
clangFormatVersion: 10

######################
# Lint Editor Config #
######################
# Detect trailing whitespaces, missing new lines and wrong file encodings.

editorconfig-lint:
name: Lint Editorconfig
runs-on: ubuntu-latest
if: >
github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name != github.repository
steps:
- uses: actions/checkout@v3
- uses: editorconfig-checker/action-editorconfig-checker@main
Expand Down

0 comments on commit 8260590

Please sign in to comment.