Skip to content

Commit

Permalink
Enable GitHub actions for submission (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
imos authored Jul 16, 2020
1 parent c26fd1c commit 590193f
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 2 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/submit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Submit

on:
push:
tags:
- '*'

env:
CARGO_TERM_COLOR: always

jobs:
submit:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Test
env:
UNAGI_GITHUB_TOKEN: ${{ secrets.UNAGI_GITHUB_TOKEN }}
run: |
git config --global user.email "[email protected]"
git config --global user.name "ninetan"
bash script/create-submission.sh
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
# Files for builds.
/build
/.cache
/vendor
9 changes: 7 additions & 2 deletions script/create-submission.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ cd "$(dirname "${BASH_SOURCE}")/.."
if [ -d build/submission ]; then
rm -rf build/submission
fi
git clone -b submission --single-branch --depth=1 \
[email protected]:imos/icfpc2020-submission.git build/submission
if [ "${UNAGI_GITHUB_TOKEN:-}" != '' ]; then
REPOSITORY_URI="https://$UNAGI_GITHUB_TOKEN@github.com/imos/icfpc2020-submission.git"
else
[email protected]:imos/icfpc2020-submission.git
fi
git clone -b submission --single-branch --depth=1 "${REPOSITORY_URI}" build/submission

DATETIME="$(TZ=Asia/Tokyo date +%Y%m%d-%H%M%S)"
COMMIT_ID="$(git rev-parse --short HEAD)"
COMMIT_MSG="$(git log -n 1)"
Expand Down
20 changes: 20 additions & 0 deletions submission/.github/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Rust

on:
push:
branches: [ submission ]
pull_request:
branches: [ submission ]

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build
run: cd app && cargo build --release --offline
- name: Run tests
run: cd app && cargo test --verbose

0 comments on commit 590193f

Please sign in to comment.