Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
f487b847
Commit
f487b847
authored
Feb 16, 2023
by
Edward Thomson
Committed by
Edward Thomson
Feb 16, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
actions: simplify execution with composite action
parent
795758d2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
37 deletions
+59
-37
.github/actions/run-build/action.yml
+45
-0
.github/workflows/main.yml
+14
-37
No files found.
.github/actions/run-build/action.yml
0 → 100644
View file @
f487b847
# Run a build step in a container or directly on the Actions runner
name
:
Run Build Step
description
:
Run a build step in a container or directly on the Actions runner
inputs
:
command
:
description
:
Command to run
required
:
true
type
:
string
container
:
description
:
Optional container to run in
type
:
string
container-version
:
description
:
Version of the container to run
type
:
string
runs
:
using
:
'
composite'
steps
:
-
run
:
|
if [ -n "${{ inputs.container }}" ]; then
docker run \
--rm \
--user "$(id -u):$(id -g)" \
-v "$(pwd)/source:/home/libgit2/source" \
-v "$(pwd)/build:/home/libgit2/build" \
-w /home/libgit2 \
-e ASAN_SYMBOLIZER_PATH \
-e CC \
-e CFLAGS \
-e CMAKE_GENERATOR \
-e CMAKE_OPTIONS \
-e GITTEST_NEGOTIATE_PASSWORD \
-e GITTEST_FLAKY_STAT \
-e PKG_CONFIG_PATH \
-e SKIP_NEGOTIATE_TESTS \
-e SKIP_SSH_TESTS \
-e TSAN_OPTIONS \
-e UBSAN_OPTIONS \
${{ inputs.container-version }} \
/bin/bash -c "${{ inputs.command }}"
else
${{ inputs.command }}
fi
shell
:
bash
.github/workflows/main.yml
View file @
f487b847
...
...
@@ -286,43 +286,20 @@ jobs:
docker build -t ${{ env.docker-registry-container-sha }} --build-arg UID=$(id -u) --build-arg GID=$(id -g) ${BASE_ARG} -f ${{ env.dockerfile }} .
working-directory
:
${{ env.docker-config-path }}
if
:
matrix.platform.container.name != '' && env.docker-container-exists != 'true'
-
name
:
Build and test
run
:
|
export GITTEST_NEGOTIATE_PASSWORD="${{ secrets.GITTEST_NEGOTIATE_PASSWORD }}"
export GITTEST_GITHUB_SSH_KEY="${{ secrets.GITTEST_GITHUB_SSH_KEY }}"
export GITTEST_GITHUB_SSH_PUBKEY="${{ secrets.GITTEST_GITHUB_SSH_PUBKEY }}"
export GITTEST_GITHUB_SSH_PASSPHRASE="${{ secrets.GITTEST_GITHUB_SSH_PASSPHRASE }}"
export GITTEST_GITHUB_SSH_REMOTE_HOSTKEY="${{ secrets.GITTEST_GITHUB_SSH_REMOTE_HOSTKEY }}"
if [ -n "${{ matrix.platform.container.name }}" ]; then
mkdir build
docker run \
--rm \
--user "$(id -u):$(id -g)" \
-v "$(pwd)/source:/home/libgit2/source" \
-v "$(pwd)/build:/home/libgit2/build" \
-w /home/libgit2 \
-e ASAN_SYMBOLIZER_PATH \
-e CC \
-e CFLAGS \
-e CMAKE_GENERATOR \
-e CMAKE_OPTIONS \
-e GITTEST_NEGOTIATE_PASSWORD \
-e GITTEST_FLAKY_STAT \
-e PKG_CONFIG_PATH \
-e SKIP_NEGOTIATE_TESTS \
-e SKIP_SSH_TESTS \
-e TSAN_OPTIONS \
-e UBSAN_OPTIONS \
${{ env.docker-registry-container-sha }} \
/bin/bash -c "cd build && ../source/ci/build.sh && ../source/ci/test.sh"
else
mkdir build
cd build
../source/ci/build.sh
../source/ci/test.sh
fi
shell
:
bash
-
name
:
Prepare build
run
:
mkdir build
-
name
:
Build
uses
:
./.github/actions/run-build
with
:
command
:
cd build && ../source/ci/build.sh
container
:
${{ matrix.platform.container.name }}
container-version
:
${{ env.docker-registry-container-sha }}
-
name
:
Test
uses
:
.github/workflows/run-build.yml@ethomson/workflow
with
:
command
:
cd build && ../source/ci/test.sh
container
:
${{ matrix.platform.container.name }}
container-version
:
${{ env.docker-registry-container-sha }}
-
name
:
Upload test results
uses
:
actions/upload-artifact@v3
if
:
success() || failure()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment