Skip to content

Commit

Permalink
chore: consolidate dafny version (#103)
Browse files Browse the repository at this point in the history
Have a single place for dafny version for CI
  • Loading branch information
seebees authored Oct 24, 2023
1 parent 0b39992 commit 66c493d
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 14 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ci_static-analysis.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# This workflow performs static analysis checks.
name: static analysis

on: ["pull_request", "push"]
on:
pull_request:
push:
branches:
- main

jobs:
not-grep:
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/dafny_version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This workflow reads the project.properties
# into the environment variables
# and then creates an output variable for `dafnyVersion`
name: Dafny Version

on:
workflow_call:
outputs:
version:
description: "The dafny version"
value: ${{ jobs.getDafnyVersion.outputs.version }}

jobs:
getDafnyVersion:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.read_property.outputs.dafnyVersion }}
steps:
- uses: actions/checkout@v2
- name: Read version from Properties-file
id: read_property
uses: christian-draeger/[email protected]
with:
path: './project.properties'
properties: 'dafnyVersion'
20 changes: 16 additions & 4 deletions .github/workflows/daily_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,31 @@ on:
- cron: "00 15 * * 1-5"

jobs:
daily-ci-verification:
getVersion:
# Don't run the cron builds on forks
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
uses: ./.github/workflows/dafny_version.yaml
daily-ci-format:
needs: getVersion
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
uses: ./.github/workflows/library_format.yml
with:
dafny: ${{needs.getVersion.outputs.version}}
daily-ci-verification:
needs: getVersion
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
uses: ./.github/workflows/library_dafny_verification.yml
with:
dafny: '4.2.0'
dafny: ${{needs.getVersion.outputs.version}}
daily-ci-java:
needs: getVersion
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
uses: ./.github/workflows/library_java_tests.yml
with:
dafny: '4.2.0'
dafny: ${{needs.getVersion.outputs.version}}
daily-ci-net:
needs: getVersion
if: github.event_name != 'schedule' || github.repository_owner == 'aws'
uses: ./.github/workflows/library_net_tests.yml
with:
dafny: '4.2.0'
dafny: ${{needs.getVersion.outputs.version}}
2 changes: 1 addition & 1 deletion .github/workflows/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
manual-ci-format:
uses: ./.github/workflows/library_format.yml
with:
dafny: '4.2.0'
dafny: ${{ inputs.dafny }}
manual-ci-verification:
uses: ./.github/workflows/library_dafny_verification.yml
with:
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,25 @@ on:
pull_request:

jobs:
getVersion:
uses: ./.github/workflows/dafny_version.yaml
pr-ci-format:
needs: getVersion
uses: ./.github/workflows/library_format.yml
with:
dafny: '4.2.0'
dafny: ${{needs.getVersion.outputs.version}}
pr-ci-verification:
needs: getVersion
uses: ./.github/workflows/library_dafny_verification.yml
with:
dafny: '4.2.0'
dafny: ${{needs.getVersion.outputs.version}}
pr-ci-java:
needs: getVersion
uses: ./.github/workflows/library_java_tests.yml
with:
dafny: '4.2.0'
dafny: ${{needs.getVersion.outputs.version}}
pr-ci-net:
needs: getVersion
uses: ./.github/workflows/library_net_tests.yml
with:
dafny: '4.2.0'
dafny: ${{needs.getVersion.outputs.version}}
14 changes: 10 additions & 4 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,25 @@ on:
- main

jobs:
getVersion:
uses: ./.github/workflows/dafny_version.yaml
push-ci-format:
needs: getVersion
uses: ./.github/workflows/library_format.yml
with:
dafny: '4.2.0'
dafny: ${{needs.getVersion.outputs.version}}
push-ci-verification:
needs: getVersion
uses: ./.github/workflows/library_dafny_verification.yml
with:
dafny: '4.2.0'
dafny: ${{needs.getVersion.outputs.version}}
push-ci-java:
needs: getVersion
uses: ./.github/workflows/library_java_tests.yml
with:
dafny: '4.2.0'
dafny: ${{needs.getVersion.outputs.version}}
push-ci-net:
needs: getVersion
uses: ./.github/workflows/library_net_tests.yml
with:
dafny: '4.2.0'
dafny: ${{needs.getVersion.outputs.version}}
1 change: 1 addition & 0 deletions project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dafnyVersion=4.2.0

0 comments on commit 66c493d

Please sign in to comment.