Skip to content

Latest conformance #973

Latest conformance

Latest conformance #973

name: Latest conformance
# This workflow *only* tries to run the conformance checks. It is triggered periodically on a cron
# to catch when new conformance tests are added and they don't pass. It uses the latest version of
# protoc to catch any changes in conformance test.
on:
# This is needed to trigger the workflow manually from the "Actions" tab in the repo.
workflow_dispatch:
inputs: {}
# Every day at 9am.
schedule:
- cron: "0 9 * * *"
jobs:
latest-conformance-test:
name: Run conformance tests on latest protoc
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- otp: 24.2
elixir: 1.14
env:
MIX_ENV: test
steps:
- name: Checkout this repo
uses: actions/checkout@v2
- name: Update and install dependencies to build protoc locally
# Dependencies from https://github.com/protocolbuffers/protobuf/blob/main/src/README.md
run: sudo apt-get update && sudo apt-get install -y git cmake curl make g++ jq
- name: Get SHA of Protobuf repo's main branch
id: get-protobuf-sha
run: |
echo sha="$( curl -u "u:${{github.token}}" https://api.github.com/repos/protocolbuffers/protobuf/git/ref/heads/main | jq .object.sha | tr -d '"' )" >> $GITHUB_OUTPUT
- name: Checkout Protobuf repo
uses: actions/checkout@v2
with:
ref: ${{ steps.get-protobuf-sha.outputs.sha }}
repository: protocolbuffers/protobuf
submodules: true
path: protobuf
- name: Cache built Protobuf source
id: cache-protobuf-source
uses: actions/cache@v2
with:
path: protobuf
key: ${{ runner.os }}-protobuf-${{ steps.get-protobuf-sha.outputs.sha }}
- name: Build Protobuf and the conformance test runner
if: steps.cache-protobuf-source.outputs.cache-hit != 'true'
working-directory: protobuf
run: |
cmake \
-DCMAKE_BUILD_TYPE=Release \
-Dprotobuf_BUILD_TESTS=OFF \
-Dprotobuf_INSTALL=OFF \
-Dprotobuf_BUILD_CONFORMANCE=ON \
.
NUM_CPUS=$(getconf _NPROCESSORS_ONLN)
make -j "${NUM_CPUS}" protoc conformance_test_runner
- name: Add protoc to $GITHUB_PATH
run: echo "$PWD/protobuf" >> $GITHUB_PATH
- name: Install OTP and Elixir
uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp }}
elixir-version: ${{ matrix.elixir }}
- name: Get and compile dependencies
run: mix do deps.get, deps.compile
- name: Compile project
run: mix compile
- name: Run mix protobuf.conformance with the runner from Protobuf's main branch
run: mix conformance_test --verbose
env:
PROTOBUF_ROOT: ./protobuf