Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend external CI to support non-github repos #399

Merged
merged 3 commits into from
Apr 12, 2024
Merged
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
41 changes: 31 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,25 +95,42 @@ jobs:
path: report.log
if-no-files-found: ignore

fetch-external-matrix:
name: Fetch EasyCrypt External Projects Matrix
needs: [pre_job, compile-opam]
if: needs.pre_job.outputs.should_skip != 'true'
runs-on: ubuntu-20.04
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
with:
path: 'easycrypt'
- id: set-matrix
run: |
JSON=$(jq -c . < easycrypt/.github/workflows/external.json)
echo "::set-output name=matrix::${JSON}"

external:
name: Check EasyCrypt External Projects
needs: [pre_job, compile-opam]
needs: [fetch-external-matrix]
if: needs.pre_job.outputs.should_skip != 'true'
runs-on: ubuntu-20.04
container:
image: ghcr.io/easycrypt/ec-build-box
strategy:
fail-fast: false
matrix:
target: [ [ 'jasmin-eclib', 'jasmin-lang/jasmin', 'eclib', 'tests.config', 'jasmin' ] ]
target: ${{fromJson(needs.fetch-external-matrix.outputs.matrix)}}
steps:
- uses: actions/checkout@v3
with:
path: 'easycrypt'
- uses: actions/checkout@v3
with:
path: 'project'
repository: ${{ matrix.target[1] }}
path: easycrypt
- name: Checkout External Project
run: |
git clone -b ${{ matrix.target.branch }} \
${{ matrix.target.repository }} \
project/${{ matrix.target.name }}
- name: Update OPAM & EasyCrypt dependencies
run: |
opam update
Expand All @@ -126,13 +143,17 @@ jobs:
rm -f ~/.why3.conf ~/.config/easycrypt/why3.conf
opam exec -- easycrypt why3config
- name: Compile project
working-directory: project/${{ matrix.target[2] }}
run: opam exec -- easycrypt runtest ${{ matrix.target[3] }} ${{ matrix.target[4] }}
working-directory: project/${{ matrix.target.name }}/${{ matrix.target.subdir }}
run: |
opam exec -- easycrypt runtest \
${{ matrix.target.options }} \
${{ matrix.target.config }} \
${{ matrix.target.scenario }}
- uses: actions/upload-artifact@v3
name: Upload report.log
if: always()
with:
name: report.log (${{ matrix.target[0] }})
name: report.log (${{ matrix.target.name }})
path: report.log
if-no-files-found: ignore

Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/external.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[
{ "name" : "jasmin-eclib"
, "repository" : "https://github.com/jasmin-lang/jasmin"
, "branch" : "main"
, "subdir" : "eclib"
, "config" : "tests.config"
, "scenario" : "jasmin"
, "options" : ""
}

,

{ "name" : "sha3"
, "repository" : "https://gitlab.com/easycrypt/sha3"
, "branch" : "next"
, "subdir" : "."
, "config" : "config/tests.config"
, "scenario" : "sponge"
, "options" : "-pragmas Proofs:weak"
}
]
Loading