Skip to content

Commit

Permalink
ci(CI): ✨ build binary at staging
Browse files Browse the repository at this point in the history
  • Loading branch information
Eason0729 committed Jan 7, 2024
1 parent a49f469 commit 7e4c0d4
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 8 deletions.
39 changes: 36 additions & 3 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,42 @@ jobs:
run: cd backend && just ci-test
- name: Run Frontend Test
run: cargo test -p frontend
- name: build plugin
run: cd judger && just build-plugin
- name: Run Judger test
run: cd judger && just ci-test
- name: Run testsuit
run: cd testsuit && just ci-run
run: cd testsuit && just ci-run
- name: Build judger binary
run: cargo install --target $(uname -m)-unknown-linux-musl --path judger
- name: Build backend binary
run: cargo install --target $(uname -m)-unknown-linux-musl --path backend
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- name: Create Draft Release
id: release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: staging-${{ steps.date.outputs.date }}
release_name: staging-${{ steps.date.outputs.date }}
draft: true
prerelease: false
- name: upload judger
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: target/x86_64-unknown-linux-musl/release/judger
asset_name: mdoj-judger
asset_content_type: application/octet-stream
- name: upload backend
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: target/x86_64-unknown-linux-musl/release/backend
asset_name: mdoj-backend
asset_content_type: application/octet-stream
8 changes: 3 additions & 5 deletions judger/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ release-docker:
sudo docker build --build-arg ARCH=$(uname -m) -f ./Dockerfile -t mdoj-judger ..

build-plugin:
mkdir -p config plugins-out
cd plugins && sh build-all.sh

release-plugin:
Expand All @@ -16,10 +17,6 @@ build-nsjail:
prepare:
just build-nsjail
just build-plugin
mkdir -p config plugins-out

feodra-deps:
sudo dnf install protobuf-devel autoconf gettext libtool gcc libcap-devel systemd-devel yajl-devel libgcrypt-devel glibc-static libseccomp-devel python36 git

clean:
sudo rm -rf .temp
Expand All @@ -40,4 +37,5 @@ run:
cargo run

ci-test:
just test
just ci-test
just test

0 comments on commit 7e4c0d4

Please sign in to comment.