-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace Travis CI with Github Actions (#378)
- Loading branch information
1 parent
bd889ab
commit 04f8e83
Showing
9 changed files
with
194 additions
and
125 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Any branch uploads | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
any-branch-uploads: | ||
if: ${{ github.repository == 'p4lang/p4runtime' }} | ||
runs-on: [ubuntu-latest] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build spec | ||
run: | | ||
docker run -v `pwd`/docs/v1:/usr/src/p4-spec p4lang/p4rt-madoko:latest make | ||
ls docs/v1/build | ||
- name: Upload spec to S3 if needed | ||
uses: jakejarvis/[email protected] | ||
with: | ||
args: --acl public-read --follow-symlinks --delete | ||
env: | ||
AWS_S3_BUCKET: 'p4runtime' | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
AWS_REGION: 'us-west-2' | ||
SOURCE_DIR: 'docs/v1/build' | ||
DEST_DIR: ci/${{ github.ref_name }} # only runs for push events |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Check generated code | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
check-codegen: | ||
runs-on: [ubuntu-latest] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Compile protobufs | ||
run: | | ||
docker build -t p4runtime-ci -f codegen/Dockerfile . | ||
docker run -t p4runtime-ci /p4runtime/codegen/compile_protos.sh /tmp | ||
- name: Check codegen | ||
run: | | ||
./CI/check_codegen.sh |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Main branch uploads | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
main-branch-uploads: | ||
if: ${{ github.repository == 'p4lang/p4runtime' }} | ||
runs-on: [ubuntu-latest] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
# fetch all history for all branches and tags | ||
fetch-depth: 0 | ||
- name: Build spec | ||
run: | | ||
docker run -v `pwd`/docs/v1:/usr/src/p4-spec p4lang/p4rt-madoko:latest make | ||
ls docs/v1/build | ||
- name: Upload spec to S3 | ||
uses: jakejarvis/[email protected] | ||
with: | ||
args: --acl public-read --follow-symlinks --delete | ||
env: | ||
AWS_S3_BUCKET: 'p4runtime' | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
AWS_REGION: 'us-west-2' | ||
SOURCE_DIR: 'docs/v1/build' | ||
DEST_DIR: docs/main | ||
- name: Prepare spec for upload to gh-pages | ||
run: | | ||
git checkout gh-pages | ||
mkdir -p spec | ||
rm -rf spec/main | ||
cp -r docs/v1/build spec/main | ||
- name: Upload spec to gh-pages | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
add: 'spec' | ||
author_name: 'P4Runtime CI' | ||
author_email: '[email protected]' | ||
default_author: github_actions | ||
message: 'Publish spec from Github Actions' | ||
commit: '--amend' | ||
push: 'origin gh-pages --force' |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Build spec | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
madoko-lint: | ||
runs-on: [ubuntu-latest] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Run linter | ||
run: | | ||
./tools/madokolint.py docs/v1/P4Runtime-Spec.mdk | ||
build-spec: | ||
runs-on: [ubuntu-latest] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Build spec | ||
run: | | ||
docker run -v `pwd`/docs/v1:/usr/src/p4-spec p4lang/p4rt-madoko:latest make | ||
ls docs/v1/build |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Tag uploads | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
tag-uploads: | ||
if: ${{ github.repository == 'p4lang/p4runtime' }} | ||
runs-on: [ubuntu-latest] | ||
env: | ||
TAG: ${{ github.ref }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
# fetch all history for all branches and tags | ||
fetch-depth: 0 | ||
- name: Build spec | ||
run: | | ||
docker run -v `pwd`/docs/v1:/usr/src/p4-spec p4lang/p4rt-madoko:latest make | ||
ls docs/v1/build | ||
- name: Upload spec to S3 | ||
uses: jakejarvis/[email protected] | ||
with: | ||
args: --acl public-read --follow-symlinks --delete | ||
env: | ||
AWS_S3_BUCKET: 'p4runtime' | ||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
AWS_REGION: 'us-west-2' | ||
SOURCE_DIR: 'docs/v1/build' | ||
DEST_DIR: docs/${{ github.ref }} | ||
- name: Prepare spec for upload to gh-pages | ||
run: | | ||
git checkout gh-pages | ||
mkdir -p spec | ||
rm -rf spec/$TAG | ||
cp -r docs/v1/build spec/$TAG | ||
- name: Upload spec to gh-pages | ||
uses: EndBug/add-and-commit@v9 | ||
with: | ||
add: 'spec' | ||
author_name: 'P4Runtime CI' | ||
author_email: '[email protected]' | ||
default_author: github_actions | ||
message: 'Publish spec from Github Actions' | ||
commit: '--amend' | ||
push: 'origin gh-pages --force' | ||
|
||
publish-to-pypi: | ||
name: Publish a Python distribution to PyPI | ||
if: ${{ github.repository == 'p4lang/p4runtime' }} | ||
runs-on: [ubuntu-latest] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
packages_dir: py/ | ||
skip_existing: true |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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