Skip to content

Commit

Permalink
Add submission test (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
imos authored Jul 16, 2020
1 parent 0f22dfa commit 18427ee
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 13 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/submission.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Submission

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

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Test
run: make submission
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ usage:
test:
echo 'This is test target'

.PHONY: submission
submission:
@rm -rf build/submission
bash script/build-submission.sh

.PHONY: deploy-dashboard
deploy-dashboard:
cd go/cmd/dashboard && unagi --bare make deploy
Expand Down
25 changes: 25 additions & 0 deletions script/build-submission.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash

set -eux
shopt -s dotglob

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

mkdir -p build/submission

pushd build/submission
for f in *; do
if [ "${f}" == '.git' ]; then
continue
fi
rm -rf "${f}"
done
popd

cp -a app build/submission/app
cp -a Cargo.toml build/submission/
cp -a submission/* build/submission/

pushd build/submission
cargo vendor
popd
14 changes: 1 addition & 13 deletions script/create-submission.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,9 @@ COMMIT_MSG="$(git log -n 1)"

pushd build/submission
git checkout -b "candidates/${DATETIME}-${COMMIT_ID}"
for f in *; do
if [ "${f}" == '.git' ]; then
continue
fi
rm -rf "${f}"
done
popd

cp -a app build/submission/app
cp -a Cargo.toml build/submission/
cp -a submission/* build/submission/

pushd build/submission
cargo vendor
popd
bash script/build-submission.sh

pushd build/submission
git add -A
Expand Down

0 comments on commit 18427ee

Please sign in to comment.