Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YAML formatting from Redhead YAML language server. #4521

Merged
merged 2 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-auto-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Automated Release

on:
schedule:
- cron: '0 12 1 * *' # At 12:00 on day-of-month 1
- cron: "0 12 1 * *" # At 12:00 on day-of-month 1

jobs:
build:
Expand Down
106 changes: 53 additions & 53 deletions .github/workflows/ci-bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,84 +2,84 @@ name: "bazel"

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
merge_group:
branches: [ main ]
branches: [main]

# Cancel any preceding run on the pull request.
concurrency:
group: bazel-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
build_direct: # Build p4c directly.
build_direct: # Build p4c directly.
runs-on: ubuntu-latest
env:
BAZEL: bazelisk-linux-amd64
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Mount bazel cache
uses: actions/cache@v4
with:
# See https://docs.bazel.build/versions/master/output_directories.html
path: "~/.cache/bazel"
# Create cash entry for every run (by using unique key derived from commit hash).
# See https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows
key: ${{ runner.os }}-build-direct-${{ github.sha }}
restore-keys: |
${{ runner.os }}-build-direct-
- name: Mount bazel cache
uses: actions/cache@v4
with:
# See https://docs.bazel.build/versions/master/output_directories.html
path: "~/.cache/bazel"
# Create cash entry for every run (by using unique key derived from commit hash).
# See https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows
key: ${{ runner.os }}-build-direct-${{ github.sha }}
restore-keys: |
${{ runner.os }}-build-direct-

- name: Install bazelisk
run: |
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.18.0/$BAZEL"
chmod +x $BAZEL
sudo mv $BAZEL /usr/local/bin/bazel
- name: Install bazelisk
run: |
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.18.0/$BAZEL"
chmod +x $BAZEL
sudo mv $BAZEL /usr/local/bin/bazel

- name: First, pass the lint test
run: bazel run //:buildifier_check
- name: First, pass the lint test
run: bazel run //:buildifier_check

- name: Install Flex and Bison
run: sudo apt-get update && sudo apt-get install bison flex libfl-dev
- name: Install Flex and Bison
run: sudo apt-get update && sudo apt-get install bison flex libfl-dev

- name: Build p4c
run: bazel build //... --verbose_failures
- name: Build p4c
run: bazel build //... --verbose_failures

build_indirect: # Build 3rd party Bazel project depending on p4c as a subproject.
build_indirect: # Build 3rd party Bazel project depending on p4c as a subproject.
runs-on: ubuntu-latest
env:
BAZEL: bazelisk-linux-amd64
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Mount bazel cache
uses: actions/cache@v4
with:
# See https://docs.bazel.build/versions/master/output_directories.html
path: "~/.cache/bazel"
# Create cash entry for every run (by using unique key derived from commit hash).
# See https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows
key: ${{ runner.os }}-build-indirect-${{ github.sha }}
restore-keys: |
${{ runner.os }}-build-indirect-
- name: Mount bazel cache
uses: actions/cache@v4
with:
# See https://docs.bazel.build/versions/master/output_directories.html
path: "~/.cache/bazel"
# Create cash entry for every run (by using unique key derived from commit hash).
# See https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows
key: ${{ runner.os }}-build-indirect-${{ github.sha }}
restore-keys: |
${{ runner.os }}-build-indirect-

- name: First, pass the lint test
run: bazel run //:buildifier_check
- name: First, pass the lint test
run: bazel run //:buildifier_check

- name: Install bazelisk
run: |
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.18.0/$BAZEL"
chmod +x $BAZEL
sudo mv $BAZEL /usr/local/bin/bazel
- name: Install bazelisk
run: |
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.18.0/$BAZEL"
chmod +x $BAZEL
sudo mv $BAZEL /usr/local/bin/bazel

- name: Install Flex and Bison
run: sudo apt-get update && sudo apt-get install bison flex libfl-dev
- name: Install Flex and Bison
run: sudo apt-get update && sudo apt-get install bison flex libfl-dev

- name: Build bazel/example
run: cd ./bazel/example && bazel build //... --verbose_failures
- name: Build bazel/example
run: cd ./bazel/example && bazel build //... --verbose_failures
70 changes: 35 additions & 35 deletions .github/workflows/ci-container-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ name: container-image

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
merge_group:
branches: [ main ]
branches: [main]

schedule:
# Ideally, we would update the image every time the base image
# (p4lang/behavioral-model) is updated, this is good enough.
# "At minute 15 past every 4th hour from midnight through 23."
- cron: '15 0-23/4 * * *'
- cron: "15 0-23/4 * * *"

# Cancel any preceding run on the pull request.
concurrency:
Expand All @@ -24,34 +24,34 @@ jobs:
if: ${{ github.repository == 'p4lang/p4c' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Determine Docker image tag
id: get-tag
shell: bash
run: |
TAG=""
if [[ "$GITHUB_REF" =~ "main" ]]; then
TAG="latest"
else
TAG=${GITHUB_REF////_}
fi
echo "Tag is $TAG"
echo "::set-output name=tag::$TAG"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image to registry
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: p4lang/p4c:${{ steps.get-tag.outputs.tag }}
cache-from: type=gha
cache-to: type=gha,mode=max
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Determine Docker image tag
id: get-tag
shell: bash
run: |
TAG=""
if [[ "$GITHUB_REF" =~ "main" ]]; then
TAG="latest"
else
TAG=${GITHUB_REF////_}
fi
echo "Tag is $TAG"
echo "::set-output name=tag::$TAG"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push Docker image to registry
uses: docker/build-push-action@v5
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: p4lang/p4c:${{ steps.get-tag.outputs.tag }}
cache-from: type=gha
cache-to: type=gha,mode=max
72 changes: 36 additions & 36 deletions .github/workflows/ci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: "p4c-lint"

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
merge_group:
branches: [ main ]
branches: [main]

jobs:
p4c-lint:
Expand All @@ -15,36 +15,36 @@ jobs:
IMAGE_TYPE: test
CMAKE_ONLY: ON
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-python@v5

- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: apply-linters-${{ runner.os }}
max-size: 1000M

# TODO: This check is disabled because git on the Github serves behaves differently. Unclear why.
# - name: Check submodule ref points.
# run: |
# ./tools/check-git-submodules.sh

- name: Build (Ubuntu 20.04)
run: |
tools/ci-build.sh

- name: Run cpplint on C/C++ files.
run: make cpplint
working-directory: ./build

- name: Run clang-format on C/C++ files.
run: make clang-format
working-directory: ./build

- name: Run black and isort on Python files.
run: |
make black
make isort
working-directory: ./build
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-python@v5

- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: apply-linters-${{ runner.os }}
max-size: 1000M

# TODO: This check is disabled because git on the Github serves behaves differently. Unclear why.
# - name: Check submodule ref points.
# run: |
# ./tools/check-git-submodules.sh

- name: Build (Ubuntu 20.04)
run: |
tools/ci-build.sh

- name: Run cpplint on C/C++ files.
run: make cpplint
working-directory: ./build

- name: Run clang-format on C/C++ files.
run: make clang-format
working-directory: ./build

- name: Run black and isort on Python files.
run: |
make black
make isort
working-directory: ./build
36 changes: 18 additions & 18 deletions .github/workflows/ci-p4tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: "test-tools"

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
merge_group:
branches: [ main ]
branches: [main]

# Cancel any preceding run on the pull request.
concurrency:
Expand All @@ -23,21 +23,21 @@ jobs:
CMAKE_UNITY_BUILD: ON
ENABLE_TEST_TOOLS: ON
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/checkout@v4
with:
submodules: recursive

- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: test-tools-${{ runner.os }}
max-size: 1000M
- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: test-tools-${{ runner.os }}
max-size: 1000M

- name: Build (Ubuntu 22.04)
run: |
tools/ci-build.sh
- name: Build (Ubuntu 22.04)
run: |
tools/ci-build.sh

- name: Run tests (Ubuntu 22.04)
# Need to use sudo for the eBPF kernel tests.
run: sudo -E ctest -R testgen- --output-on-failure --schedule-random
working-directory: ./build
- name: Run tests (Ubuntu 22.04)
# Need to use sudo for the eBPF kernel tests.
run: sudo -E ctest -R testgen- --output-on-failure --schedule-random
working-directory: ./build
2 changes: 1 addition & 1 deletion .github/workflows/ci-ptf-kernels-weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ name: "ptf-ebpf-kernels-weekly"
on:
schedule:
# Every sunday at 1:17 am UTC
- cron: '17 1 * * 0'
- cron: "17 1 * * 0"

env:
VM_NAME: inner
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-ptf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ name: "ptf-ebpf"

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
merge_group:
branches: [ main ]
branches: [main]

# Cancel any preceding run on the pull request.
concurrency:
Expand Down
Loading
Loading