-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from yut23/gha-reuse-actions
Move repeated workflow logic into custom actions
- Loading branch information
Showing
10 changed files
with
312 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: 'Run answer tests' | ||
description: 'Helper for workflows/answer-tests.yml' | ||
inputs: | ||
compiler: | ||
description: 'C++ compiler executable' | ||
required: true | ||
stdlib: | ||
description: 'C++ standard library to use (libstdc++ or libc++)' | ||
required: false | ||
default: libstdc++ | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- shell: bash | ||
working-directory: ${{ matrix.TARGET.directory }} | ||
env: | ||
CXX: ${{ inputs.compiler }} | ||
USE_LIBCXX: ${{ inputs.stdlib == 'libc++' && 'TRUE' || 'FALSE' }} | ||
run: | | ||
echo | ||
echo '::group::Compiler version' | ||
$CXX --version | ||
echo '::endgroup::' | ||
echo '::group::Build target' | ||
make --silent clean | ||
make build/release/${{ matrix.TARGET.name }} | ||
echo '::endgroup::' | ||
echo | ||
./run_answer_tests.sh ${{ matrix.TARGET.name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: 'Build target' | ||
description: 'Helper for workflows/test-build.yml' | ||
inputs: | ||
compiler: | ||
description: 'C++ compiler executable' | ||
required: true | ||
stdlib: | ||
description: 'C++ standard library to use (libstdc++ or libc++)' | ||
required: false | ||
default: libstdc++ | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- shell: bash | ||
working-directory: ${{ matrix.TARGET.directory }} | ||
env: | ||
CXX: ${{ inputs.compiler }} | ||
USE_LIBCXX: ${{ inputs.stdlib == 'libc++' && 'TRUE' || 'FALSE' }} | ||
run: | | ||
echo | ||
echo '::group::Compiler version' | ||
$CXX --version | ||
echo '::endgroup::' | ||
echo | ||
make -j4 DISABLE_SANITIZERS=TRUE build/release/${{ matrix.TARGET.name }} build/debug/${{ matrix.TARGET.name }} build/fast/${{ matrix.TARGET.name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: 'Run unit tests' | ||
description: 'Helper for workflows/unit-tests.yml' | ||
inputs: | ||
compiler: | ||
description: 'C++ compiler executable' | ||
required: true | ||
stdlib: | ||
description: 'C++ standard library to use (libstdc++ or libc++)' | ||
required: false | ||
default: libstdc++ | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- shell: bash | ||
working-directory: ${{ matrix.TARGET.directory }} | ||
env: | ||
CXX: ${{ inputs.compiler }} | ||
USE_LIBCXX: ${{ inputs.stdlib == 'libc++' && 'TRUE' || 'FALSE' }} | ||
run: | | ||
echo | ||
echo '::group::Compiler version info' | ||
$CXX --version | ||
echo '::endgroup::' | ||
echo '::group::Build target' | ||
make --silent clean | ||
make build/debug/${{ matrix.TARGET.name }} | ||
echo '::endgroup::' | ||
echo | ||
make ${{ matrix.TARGET.name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Test gen_matrix.py | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Python 3.10 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pytest | ||
- name: Run pytest | ||
run: pytest -v .github/workflows/test_gen_matrix.py |
Oops, something went wrong.