Skip to content

Commit

Permalink
Merge branch 'master' of github.com:imos/icfpc2020
Browse files Browse the repository at this point in the history
  • Loading branch information
chokudai committed Jul 19, 2020
2 parents 272bc6e + 49741a1 commit 77cb330
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 1 deletion.
19 changes: 19 additions & 0 deletions .github/workflows/ai.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: AICheck

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
- name: Test
run: make ai-check
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ submission-test: submission
performance:
bash test/performance_test.sh

.PHONY: ai-check
ai-check:
bash test/ai_name_test.sh

.PHONY: deploy-dashboard
deploy-dashboard:
cd go/cmd/dashboard && unagi --bare make deploy
Expand Down
7 changes: 6 additions & 1 deletion submission/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,10 @@ export JUDGE_SERVER=1

source ./AI

./app "${AI_FLAGS[@]}" ${EXTRA_FLAGS:-} "$@" || \
args=(./app)
if [ "${#AI_FLAGS[*]}" -ne 0 ]; then
args+=("${AI_FLAGS[@]}")
fi

"${args[@]}" ${EXTRA_FLAGS:-} "$@" || \
echo "ERROR: exit_code=$?"
19 changes: 19 additions & 0 deletions test/ai_name_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

set -eux

cd "$(dirname "${BASH_SOURCE}")/.."

source ./AI

if [ ! -f "src/bin/${AI_NAME}.rs" ]; then
echo "src/bin/${AI_NAME}.rs does not exist!"
exit 1
fi

args=(./app)
if [ "${#AI_FLAGS[*]}" -ne 0 ]; then
args+=("${AI_FLAGS[@]}")
fi

echo "${args[@]}"

0 comments on commit 77cb330

Please sign in to comment.