#2: remove docker debug output #137
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
name: Build and Test (Template) | |
# Template workflow to build and test a project in all available setup configurations | |
# WIP: This is currently a work in progress (#2: Docker image usage) | |
on: | |
push: | |
branches: | |
- 2-implement-common-docker-containers | |
jobs: | |
get-matrix: | |
name: Retrieve Setup matrix | |
runs-on: ubuntu-latest | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
CI_REPO: DARMA-tasking/workflows | |
CI_BRANCH: 2-implement-common-docker-containers # should be master in the future | |
steps: | |
- name: Retrieve Setup matrix | |
id: get-matrix | |
run: | | |
wget https://raw.githubusercontent.com/${{ env.CI_REPO }}/refs/heads/${{ env.CI_BRANCH }}/ci/shared/matrix/github.json | |
matrix=$(cat github.json | jq '.matrix') | |
echo "runner=$(echo $matrix)" >> $GITHUB_OUTPUT | |
outputs: | |
matrix: ${{ steps.get-matrix.outputs.runner }} | |
run: | |
name: Run (${{ matrix.runner.label }}) | |
runs-on: ${{ matrix.runner.runs-on }} | |
needs: get-matrix | |
strategy: | |
fail-fast: false | |
matrix: | |
runner: ${{ fromJson(needs.get-matrix.outputs.matrix ) }} | |
steps: | |
- name: Display configuration | |
run: | | |
echo "Environment=${{ matrix.runner.label }}" | |
echo "Runner=${{ matrix.runner.runs-on }}" | |
if [ "${{ matrix.runner.image }}" != "" ] | |
then | |
echo "> With Docker Image=${{ matrix.runner.image }}" | |
else | |
echo "> With Runner Setup=${{ matrix.runner.setup }}" | |
fi | |
- name: Set up dependencies | |
run: | | |
if [[ "${{ matrix.runner.image }}" == "" ]]; then | |
echo "::group::Setup in runner" | |
echo "Set setup permissions..." | |
sudo mkdir -p /opt | |
sudo chown $(whoami) /opt | |
wget -O setup.sh https://raw.githubusercontent.com/DARMA-tasking/workflows/refs/heads/2-implement-common-docker-containers/ci/shared/scripts/setup-${{ matrix.runner.setup }}.sh | |
chmod +x setup.sh | |
export SETUP_ID=${{ matrix.runner.setup }} | |
./setup.sh | |
echo "::endgroup::" | |
fi | |
if [[ "${{ matrix.runner.image }}" != "" ]]; then | |
echo "::group::Pull Docker image" | |
docker image pull ${{ matrix.runner.image }} | |
echo "::endgroup::" | |
fi | |
- name: Run (example) | |
run: | | |
CMD="uname -a" | |
if [[ "${{ matrix.runner.image }}" == "" ]] | |
then | |
$CMD | |
else | |
docker run ${{ matrix.runner.image }} $CMD | |
fi | |
# - name: Build and test | |
# TODO: Build an test step. | |
# > Option 1: Docker image (Environment Setup="docker") WIP | |
# - pull the docker image | |
# - build & Test using `docker exec [container] build_and_test.sh` for example or by using an inner build_and_test docker image | |
# - (TODO: copy artifacts using a volume) | |
# > Option 2: Current runner (Environment Setup="local") (Future for some macos) | |
# - setup dependencies here directly | |
# (Here a work needs to be done to determine how to get the dependencies script. It might be shared by the workflows repo and put in matrix) | |
# - build & Test using build_and_test.sh | |
# - name: Upload artifacts | |
# - name: Report test results | |
# note: (as in vt-tv or LBAF) | |
# - name: Report coverage |