copy file? #9
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: Docker CI | |
# Controls when the action will run. | |
on: | |
push: | |
branches: | |
- docker-compose | |
# paths: | |
# - 'algorithms/**' | |
# - 'experiment/**' | |
# - '.github/workflows/**' | |
# pull_request: | |
# paths: | |
# - 'algorithms/**' | |
# - 'experiment/**' | |
# - '.github/workflows/**' | |
# workflow_dispatch: | |
# env: | |
# USER: ${{ secrets.DOCKER_HUB_USERNAME }} | |
# PASS: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
# APP: srbench | |
jobs: | |
################################################################################ | |
# get a list of algorithms | |
################################################################################ | |
list-algs: | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- uses: actions/checkout@v3 | |
- id: set-matrix | |
run: echo "::set-output name=matrix::$(ls algorithms/ | jq -R -s -c 'split("\n")[:-1]')" | |
################################################################################ | |
# build each algorithm in parallel and run tests | |
################################################################################ | |
build-and-test: | |
runs-on: ubuntu-latest | |
needs: | |
- list-algs | |
defaults: | |
run: | |
shell: bash -l {0} | |
strategy: | |
matrix: | |
alg: ${{ fromJson(needs.list-algs.outputs.matrix) }} | |
fail-fast: false | |
steps: | |
- | |
name: Checkout code | |
uses: actions/checkout@v3 | |
- | |
name: Build docker image | |
run: | | |
bash scripts/make_docker_compose_file.sh | |
# docker compose build --pull ${{ matrix.alg }} | |
docker compose run --build ${{ matrix.alg }} bash test.sh | |
################################################################################ | |
# tests | |
################################################################################ | |
# - | |
# name: Test Method | |
# run: | | |
# docker compose run ${{ matrix.alg }} bash test.sh | |
# - | |
# name: Push docker image | |
# run: docker compose push ${{ matrix.alg }} |