Skip to content

Commit 8ebe973

Browse files
committed
CI: Cron triggered conformance tests.
Fixes apple#1047
1 parent 60025e7 commit 8ebe973

File tree

2 files changed

+83
-0
lines changed

2 files changed

+83
-0
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Build and Test
22

3+
# NOTE: If making changes to most of the steps, please also look to update
4+
# regular_conformance.yml also.
5+
36
on:
47
push:
58
branches: [ master ]
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Run Conformance Tests
2+
3+
# This workflow is a subset of the build.yml. It *only* try to run the
4+
# conformance checks. It is triggered weekly on a cron to catch when new
5+
# conformance tests are added and they don't pass.
6+
#
7+
# Without this workflow the new tests wouldn't be noticed until a PR was made.
8+
#
9+
# This workflow shares the caching logic with build.yml. It should serve to
10+
# update a subset of the caches for when things do land on trunk. If that
11+
# is deemed not worth it in the future, this can be simplify.
12+
13+
# NOTE: If making changes to most of the steps, please also look to update
14+
# build.yml also.
15+
16+
on:
17+
schedule:
18+
# Every Sunday at 5am.
19+
- cron: '0 5 * * 0'
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-18.04
24+
strategy:
25+
matrix:
26+
swift: ["5.2.5-bionic"]
27+
# protobuf_git can reference a commit, tag, or branch
28+
# commit: "commits/6935eae45c99926a000ecbef0be20dfd3d159e71"
29+
# tag: "ref/tags/v3.11.4"
30+
# branch: "ref/heads/master"
31+
protobuf_git: ["ref/heads/master"]
32+
container:
33+
image: swift:${{ matrix.swift }}
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v2
37+
with:
38+
path: main
39+
- name: Update and install dependencies
40+
# dependencies from https://github.com/protocolbuffers/protobuf/blob/master/src/README.md
41+
# this step is run before get-sha because we need curl and jq for get-sha
42+
run: apt-get update && apt-get install -y autoconf automake libtool curl make g++ unzip jq
43+
- name: Get Protobuf Commit SHA
44+
id: get-sha
45+
run: |
46+
set -eu
47+
url="https://api.github.com/repos/protocolbuffers/protobuf/git/${{ matrix.protobuf_git }}"
48+
case ${{ matrix.protobuf_git }} in
49+
ref/*)
50+
echo ::set-output name=sha::$( curl -s -u "u:${{ github.token }}" "${url}" | jq -r .object.sha )
51+
;;
52+
commits/*)
53+
echo ::set-output name=sha::$( curl -s -u "u:${{ github.token }}" "${url}" | jq -r .sha )
54+
;;
55+
esac
56+
- name: Cache protobuf
57+
id: cache-protobuf
58+
uses: actions/cache@v1
59+
with:
60+
path: protobuf
61+
# NOTE: for refs that can float like 'master' the cache might be out of date!
62+
key: ${{ runner.os }}-${{ matrix.swift}}-protobuf-${{ steps.get-sha.outputs.sha }}
63+
- name: Checkout protobuf repo
64+
if: steps.cache-protobuf.outputs.cache-hit != 'true'
65+
uses: actions/checkout@v2
66+
with:
67+
repository: protocolbuffers/protobuf
68+
ref: ${{ steps.get-sha.outputs.sha }}
69+
path: protobuf
70+
- name: Build protobuf
71+
if: steps.cache-protobuf.outputs.cache-hit != 'true'
72+
working-directory: protobuf
73+
run: |
74+
./autogen.sh
75+
./configure
76+
make -C ./src
77+
make -C ./conformance
78+
- name: Test conformance
79+
working-directory: main
80+
run: make test-conformance

0 commit comments

Comments
 (0)