Skip to content

Commit

Permalink
[CI] Upload standalone archives to releases
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonGross committed Nov 13, 2023
1 parent a6d9e65 commit 2c57844
Show file tree
Hide file tree
Showing 5 changed files with 489 additions and 5 deletions.
107 changes: 106 additions & 1 deletion .github/workflows/coq-alpine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
pull_request:
merge_group:
workflow_dispatch:
release:
types: [published]
schedule:
- cron: '0 0 1 * *'

Expand Down Expand Up @@ -94,12 +96,115 @@ jobs:
- name: display per-line timing info
run: etc/ci/github-actions-display-per-line-timing.sh

test-standalone:
strategy:
fail-fast: false
matrix:
include:
- alpine: 'edge'
# - alpine: 'latest-stable'
runs-on: ubuntu-latest
name: test-standalone-${{ matrix.alpine }}
needs: build
steps:
- uses: actions/checkout@v4
- name: Download standalone ${{ matrix.alpine }}
uses: actions/download-artifact@v3
with:
name: standalone-${{ matrix.alpine }}
path: dist-${{ matrix.alpine }}/
- name: List files
run: find dist-edge
- name: Rename files
run: |
mkdir dist
mv dist-${{ matrix.alpine }}/standalone.tar.gz dist/fiat-crypto-alpine-${{ matrix.alpine }}.tar.gz
find dist
tar -tvf dist/fiat-crypto-alpine-${{ matrix.alpine }}.tar.gz
- name: Unpack files
run: |
cd dist
tar -xzvf fiat-crypto-alpine-${{ matrix.alpine }}.tar.gz
ls -la .
- name: Test files (host)
run: |
cd dist
for prog in word_by_word_montgomery unsaturated_solinas saturated_solinas base_conversion; do
echo "::group::file $prog"
file $prog
echo "::endgroup::"
echo "::group::ldd $prog"
ldd $prog
echo "::endgroup::"
echo "::group::$prog"
./$prog -h || echo "::error::$prog does not run on host" # does not work yet
echo "::endgroup::"
done
- uses: jirutka/setup-alpine@v1
with:
branch: ${{ matrix.alpine }}
extra-repositories: https://dl-cdn.alpinelinux.org/alpine/edge/testing
- name: Test files (container)
shell: alpine.sh {0}
run: |
cd dist
for prog in word_by_word_montgomery unsaturated_solinas saturated_solinas base_conversion; do
echo "::group::file $prog"
file $prog
echo "::endgroup::"
echo "::group::ldd $prog"
ldd $prog
echo "::endgroup::"
echo "::group::$prog"
./$prog -h
echo "::endgroup::"
done
publish-standalone:
runs-on: ubuntu-latest
needs: build
permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
steps:
- uses: actions/checkout@v4
- name: Download standalone edge
uses: actions/download-artifact@v3
with:
name: standalone-edge
path: dist-edge/
- name: List files
run: find dist-edge
- name: Unpack files
run: |
mkdir dist
mv dist-edge/standalone.tar.gz dist/fiat-crypto-alpine-edge.tar.gz
find dist
tar -tvf dist/fiat-crypto-alpine-edge.tar.gz
- name: Upload artifacts to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
if: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name == 'release' }}

alpine-check-all:
runs-on: ubuntu-latest
needs: [build]
needs: [build, test-standalone, publish-standalone]
if: always()
steps:
- run: echo 'build passed'
if: ${{ needs.build.result == 'success' }}
- run: echo 'test-standalone passed'
if: ${{ needs.test-standalone.result == 'success' }}
- run: echo 'publish-standalone passed'
if: ${{ needs.publish-standalone.result == 'success' }}
- run: echo 'build failed' && false
if: ${{ needs.build.result != 'success' }}
- run: echo 'test-standalone failed' && false
if: ${{ needs.test-standalone.result != 'success' }}
- run: echo 'publish-standalone failed' && false
if: ${{ needs.publish-standalone.result != 'success' }}
104 changes: 103 additions & 1 deletion .github/workflows/coq-debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
pull_request:
merge_group:
workflow_dispatch:
release:
types: [published]
schedule:
- cron: '0 0 1 * *'

Expand Down Expand Up @@ -86,12 +88,112 @@ jobs:
- name: display per-line timing info
run: etc/ci/github-actions-display-per-line-timing.sh

test-standalone:
strategy:
fail-fast: false
matrix:
include:
- debian: sid
#- debian: bookworm # restore once 8.17 lands in Debian stable
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Download standalone ${{ matrix.debian }}
uses: actions/download-artifact@v3
with:
name: standalone-${{ matrix.debian }}
path: dist-${{ matrix.debian }}/
- name: List files
run: find dist-${{ matrix.debian }}
- name: Rename files
run: |
mkdir dist
mv dist-${{ matrix.debian }}/standalone.tar.gz dist/fiat-crypto-${{ matrix.debian }}.tar.gz
find dist
tar -tvf dist/fiat-crypto-${{ matrix.debian }}.tar.gz
- name: Unpack Files
run: |
cd dist
tar -xzvf fiat-crypto-${{ matrix.debian }}.tar.gz
ls -la .
- name: Test files (host)
run: |
cd dist
for prog in word_by_word_montgomery unsaturated_solinas saturated_solinas base_conversion; do
echo "::group::file $prog"
file $prog
echo "::endgroup::"
echo "::group::ldd $prog"
ldd $prog
echo "::endgroup::"
echo "::group::$prog"
./$prog -h
echo "::endgroup::"
done
- name: setup Debian chroot
run: etc/ci/setup-debian-chroot.sh "${{ matrix.debian }}"
- name: Test files (container)
shell: in-debian-chroot.sh {0}
run: |
cd dist
for prog in word_by_word_montgomery unsaturated_solinas saturated_solinas base_conversion; do
echo "::group::file $prog"
file $prog
echo "::endgroup::"
echo "::group::ldd $prog"
ldd $prog
echo "::endgroup::"
echo "::group::$prog"
./$prog -h
echo "::endgroup::"
done
publish-standalone:
runs-on: ubuntu-latest
needs: build
permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
steps:
- uses: actions/checkout@v4
- name: Download standalone sid
uses: actions/download-artifact@v3
with:
name: standalone-sid
path: dist-sid/
- name: List files
run: find dist-sid
- name: Unpack files
run: |
mkdir dist
mv dist-sid/standalone.tar.gz dist/fiat-crypto-sid.tar.gz
find dist
tar -tvf dist/fiat-crypto-sid.tar.gz
- name: Upload artifacts to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
if: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name == 'release' }}

debian-check-all:
runs-on: ubuntu-latest
needs: [build]
needs: [build, test-standalone, publish-standalone]
if: always()
steps:
- run: echo 'build passed'
if: ${{ needs.build.result == 'success' }}
- run: echo 'test-standalone passed'
if: ${{ needs.test-standalone.result == 'success' }}
- run: echo 'publish-standalone passed'
if: ${{ needs.publish-standalone.result == 'success' }}
- run: echo 'build failed' && false
if: ${{ needs.build.result != 'success' }}
- run: echo 'test-standalone failed' && false
if: ${{ needs.test-standalone.result != 'success' }}
- run: echo 'publish-standalone failed' && false
if: ${{ needs.publish-standalone.result != 'success' }}
111 changes: 110 additions & 1 deletion .github/workflows/coq-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
pull_request:
merge_group:
workflow_dispatch:
release:
types: [published]
schedule:
- cron: '0 0 1 * *'

Expand Down Expand Up @@ -132,16 +134,123 @@ jobs:
env:
ALLOW_DIFF: 1

test-standalone:
strategy:
fail-fast: false
matrix:
include:
- coq-version: master
docker-coq-version: dev
docker-ocaml-version: default

runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Download standalone Docker
uses: actions/download-artifact@v3
with:
name: standalone-docker-coq-${{ matrix.docker-coq-version }}
path: dist-docker-coq-${{ matrix.docker-coq-version }}/
- name: List files
run: find dist-docker-coq-${{ matrix.docker-coq-version }}
- name: Rename files
run: |
mkdir dist
mv dist-docker-coq-${{ matrix.docker-coq-version }}/standalone.tar.gz dist/fiat-crypto-docker-coq-${{ matrix.docker-coq-version }}.tar.gz
find dist
tar -tvf dist/fiat-crypto-docker-coq-${{ matrix.docker-coq-version }}.tar.gz
- name: Unpack Files
run: |
cd dist
tar -xzvf fiat-crypto-docker-coq-${{ matrix.docker-coq-version }}.tar.gz
ls -la .
- name: Test files (host)
run: |
cd dist
for prog in word_by_word_montgomery unsaturated_solinas saturated_solinas base_conversion; do
echo "::group::file $prog"
file $prog
echo "::endgroup::"
echo "::group::ldd $prog"
ldd $prog
echo "::endgroup::"
echo "::group::$prog"
./$prog -h
echo "::endgroup::"
done
- name: Test files (container)
uses: coq-community/docker-coq-action@v1
with:
coq_version: ${{ matrix.docker-coq-version }}
ocaml_version: ${{ matrix.docker-ocaml-version }}
custom_script: |
echo "::group::install dependencies"
sudo apt-get update -y
sudo apt-get install -y file
echo "::endgroup::"
cd dist
for prog in word_by_word_montgomery unsaturated_solinas saturated_solinas base_conversion; do
echo "::group::file $prog"
file $prog
echo "::endgroup::"
echo "::group::ldd $prog"
ldd $prog
echo "::endgroup::"
echo "::group::$prog"
./$prog -h
echo "::endgroup::"
done
publish-standalone:
runs-on: ubuntu-latest
needs: build
permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
steps:
- uses: actions/checkout@v4
- name: Download standalone Docker
uses: actions/download-artifact@v3
with:
name: standalone-docker-coq-dev
path: dist-docker-coq-dev/
- name: List files
run: find dist-docker-coq-dev
- name: Unpack files
run: |
mkdir dist
mv dist-docker-coq-dev/standalone.tar.gz dist/fiat-crypto-docker-coq-dev.tar.gz
find dist
tar -tvf dist/fiat-crypto-docker-coq-dev.tar.gz
- name: Upload artifacts to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
if: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name == 'release' }}

docker-check-all:
runs-on: ubuntu-latest
needs: [build, test-amd64]
needs: [build, test-amd64, test-standalone, publish-standalone]
if: always()
steps:
- run: echo 'build passed'
if: ${{ needs.build.result == 'success' }}
- run: echo 'test-amd64 passed'
if: ${{ needs.test-amd64.result == 'success' }}
- run: echo 'test-standalone passed'
if: ${{ needs.test-standalone.result == 'success' }}
- run: echo 'publish-standalone passed'
if: ${{ needs.publish-standalone.result == 'success' }}
- run: echo 'build failed' && false
if: ${{ needs.build.result != 'success' }}
- run: echo 'test-amd64 failed' && false
if: ${{ needs.test-amd64.result != 'success' }}
- run: echo 'test-standalone failed' && false
if: ${{ needs.test-standalone.result != 'success' }}
- run: echo 'publish-standalone failed' && false
if: ${{ needs.publish-standalone.result != 'success' }}
Loading

0 comments on commit 2c57844

Please sign in to comment.