Skip to content
Open
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
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# SPDX-FileCopyrightText: 2026 The P4 Language Consortium
#
# SPDX-License-Identifier: Apache-2.0

name: Test

on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
verify-licenses:
runs-on: ubuntu-latest
name: Validate that all files have copyright and license info
steps:
- uses: actions/checkout@v6
- name: Install dev dependencies
run: |
./CI/install-uv.sh
- name: Validate presence of copyright and license info (python w/reuse)
run: |
uvx reuse lint
30 changes: 30 additions & 0 deletions CI/install-uv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash
# SPDX-FileCopyrightText: 2026 The P4 Language Consortium
# SPDX-License-Identifier: Apache-2.0

set -eu

UV_VERSION="${UV_VERSION:-0.11.7}"
UV_INSTALL_DIR="${HOME}/.local/bin"

if command -v uv >/dev/null 2>&1; then
exit 0
fi

mkdir -p "${UV_INSTALL_DIR}"

if command -v curl >/dev/null 2>&1; then
env UV_UNMANAGED_INSTALL="${UV_INSTALL_DIR}" \
sh -c "$(curl -LsSf https://astral.sh/uv/${UV_VERSION}/install.sh)"
elif command -v wget >/dev/null 2>&1; then
env UV_UNMANAGED_INSTALL="${UV_INSTALL_DIR}" \
sh -c "$(wget -qO- https://astral.sh/uv/${UV_VERSION}/install.sh)"
else
echo "Neither curl nor wget is available to install uv" >&2
exit 1
fi

export PATH="${UV_INSTALL_DIR}:${PATH}"
if [ -n "${GITHUB_PATH:-}" ]; then
echo "${UV_INSTALL_DIR}" >> "${GITHUB_PATH}"
fi