secp256k1
This commit is contained in:
33
secp256k1/.github/actions/install-homebrew-valgrind/action.yml
vendored
Normal file
33
secp256k1/.github/actions/install-homebrew-valgrind/action.yml
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
name: "Install Valgrind"
|
||||
description: "Install Homebrew's Valgrind package and cache it."
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- run: |
|
||||
brew tap LouisBrunner/valgrind
|
||||
brew fetch --HEAD LouisBrunner/valgrind/valgrind
|
||||
echo "CI_HOMEBREW_CELLAR_VALGRIND=$(brew --cellar valgrind)" >> "$GITHUB_ENV"
|
||||
shell: bash
|
||||
|
||||
- run: |
|
||||
sw_vers > valgrind_fingerprint
|
||||
brew --version >> valgrind_fingerprint
|
||||
git -C "$(brew --cache)/valgrind--git" rev-parse HEAD >> valgrind_fingerprint
|
||||
cat valgrind_fingerprint
|
||||
shell: bash
|
||||
|
||||
- uses: actions/cache@v4
|
||||
id: cache
|
||||
with:
|
||||
path: ${{ env.CI_HOMEBREW_CELLAR_VALGRIND }}
|
||||
key: ${{ github.job }}-valgrind-${{ hashFiles('valgrind_fingerprint') }}
|
||||
|
||||
- if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
brew install --HEAD LouisBrunner/valgrind/valgrind
|
||||
shell: bash
|
||||
|
||||
- if: steps.cache.outputs.cache-hit == 'true'
|
||||
run: |
|
||||
brew link valgrind
|
||||
shell: bash
|
||||
34
secp256k1/.github/actions/print-logs/action.yml
vendored
Normal file
34
secp256k1/.github/actions/print-logs/action.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
name: "Print logs"
|
||||
description: "Print the log files produced by ci/ci.sh"
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- shell: bash
|
||||
run: |
|
||||
# Print the log files produced by ci/ci.sh
|
||||
|
||||
# Helper functions
|
||||
group() {
|
||||
title=$1
|
||||
echo "::group::$title"
|
||||
}
|
||||
endgroup() {
|
||||
echo "::endgroup::"
|
||||
}
|
||||
cat_file() {
|
||||
file=$1
|
||||
group "$file"
|
||||
cat "$file"
|
||||
endgroup
|
||||
}
|
||||
|
||||
# Print all *.log files
|
||||
shopt -s nullglob
|
||||
for file in *.log; do
|
||||
cat_file "$file"
|
||||
done
|
||||
|
||||
# Print environment
|
||||
group "CI env"
|
||||
env
|
||||
endgroup
|
||||
54
secp256k1/.github/actions/run-in-docker-action/action.yml
vendored
Normal file
54
secp256k1/.github/actions/run-in-docker-action/action.yml
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
name: 'Run in Docker with environment'
|
||||
description: 'Run a command in a Docker container, while passing explicitly set environment variables into the container.'
|
||||
inputs:
|
||||
dockerfile:
|
||||
description: 'A Dockerfile that defines an image'
|
||||
required: true
|
||||
tag:
|
||||
description: 'A tag of an image'
|
||||
required: true
|
||||
command:
|
||||
description: 'A command to run in a container'
|
||||
required: false
|
||||
default: ./ci/ci.sh
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
|
||||
- uses: docker/build-push-action@v5
|
||||
id: main_builder
|
||||
continue-on-error: true
|
||||
with:
|
||||
context: .
|
||||
file: ${{ inputs.dockerfile }}
|
||||
tags: ${{ inputs.tag }}
|
||||
load: true
|
||||
cache-from: type=gha
|
||||
|
||||
- uses: docker/build-push-action@v5
|
||||
id: retry_builder
|
||||
if: steps.main_builder.outcome == 'failure'
|
||||
with:
|
||||
context: .
|
||||
file: ${{ inputs.dockerfile }}
|
||||
tags: ${{ inputs.tag }}
|
||||
load: true
|
||||
cache-from: type=gha
|
||||
|
||||
- # Workaround for https://github.com/google/sanitizers/issues/1614 .
|
||||
# The underlying issue has been fixed in clang 18.1.3.
|
||||
run: sudo sysctl -w vm.mmap_rnd_bits=28
|
||||
shell: bash
|
||||
|
||||
- # Tell Docker to pass environment variables in `env` into the container.
|
||||
run: >
|
||||
docker run \
|
||||
$(echo '${{ toJSON(env) }}' | jq -r 'keys[] | "--env \(.) "') \
|
||||
--volume ${{ github.workspace }}:${{ github.workspace }} \
|
||||
--workdir ${{ github.workspace }} \
|
||||
${{ inputs.tag }} bash -c "
|
||||
git config --global --add safe.directory ${{ github.workspace }}
|
||||
${{ inputs.command }}
|
||||
"
|
||||
shell: bash
|
||||
Reference in New Issue
Block a user