JOJ3/.gitea/workflows/build.yaml
张泊明518370910136 e897d2a78c
Some checks failed
submodules sync / sync (push) Successful in 28s
build / build (push) Failing after 1m11s
build / trigger-build-image (push) Has been skipped
fix(executor/sandbox): stream all files
2026-07-22 22:07:17 -07:00

61 lines
2.1 KiB
YAML

name: build
on:
- push
- pull_request
jobs:
build:
runs-on: golang-ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@focs
- name: Display Go version
run: go version
- name: Prepare
run: |
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct
mkdir -p ~/.ssh
echo "${{ secrets.DEPLOY_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/id_ed25519.pub
chmod 600 ~/.ssh/id_ed25519 ~/.ssh/id_ed25519.pub
ssh -o StrictHostKeyChecking=accept-new -T git@focs.gc.sjtu.edu.cn -p 2222
# - name: Lint
# run: make lint
- name: Build
run: make build
- name: Version
run: ./build/joj3 -version
- name: Test
run: |
make prepare-test
make ci-test
trigger-build-image:
runs-on: ubuntu-latest
needs: build
if: gitea.ref == 'refs/heads/master'
steps:
- name: Set up SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.DEPLOY_PRIVATE_KEY }}" > ~/.ssh/id_ed25519
echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/id_ed25519.pub
chmod 600 ~/.ssh/id_ed25519 ~/.ssh/id_ed25519.pub
ssh -o StrictHostKeyChecking=accept-new -T git@focs.gc.sjtu.edu.cn -p 2222
- name: Set up Git
run: |
git config --global user.name "bot-joj"
git config --global user.email "bot-joj@focs.gc.sjtu.edu.cn"
- name: Clone, Commit and Push
shell: bash
run: |
git clone ssh://git@focs.gc.sjtu.edu.cn:2222/JOJ/runner-images.git runner-images
cd runner-images
git submodule update --init --remote --force
git add -A
if echo "${{ gitea.event.head_commit.message }}" | grep -q "force build"; then
git commit --allow-empty -m "chore: ${{ gitea.repository }}@${{ gitea.sha }} trigger force build gitea actions"
else
git commit --allow-empty -m "chore: ${{ gitea.repository }}@${{ gitea.sha }} trigger build gitea actions"
fi
git push