Show other submissions of solved chapter problems correctly #854
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | |
on: | |
push: | |
branches: | |
- "*" | |
pull_request: | |
branches: | |
- master | |
jobs: | |
test: | |
runs-on: ubuntu-22.04 | |
services: | |
rabbitmq: | |
image: rabbitmq | |
ports: | |
- 5672:5672 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 50 | |
- id: changed-files | |
name: Check changed files | |
run: python3 ci/check-changed-files.py | bash | |
- name: Set up JDK | |
if: steps.changed-files.outputs.gradle == '1' | |
uses: actions/setup-java@v4 | |
with: | |
distribution: zulu | |
java-version: "11" | |
cache: gradle | |
- name: Test judgels-commons | |
if: steps.changed-files.outputs.judgels-commons == '1' | |
run: ./judgels-backends/gradlew -p judgels-backends/judgels-commons check | |
- name: Test judgels-grader-api | |
if: steps.changed-files.outputs.judgels-grader == '1' | |
run: ./judgels-backends/gradlew -p judgels-backends/judgels-grader-api check | |
- name: Test judgels-grader-engines | |
if: steps.changed-files.outputs.judgels-grader == '1' | |
run: ./judgels-backends/gradlew -p judgels-backends/judgels-grader-engines check | |
- name: Test judgels-grader-app | |
if: steps.changed-files.outputs.judgels-grader == '1' | |
run: ./judgels-backends/gradlew -p judgels-backends/judgels-grader-app check | |
- name: Test judgels-server-api | |
if: steps.changed-files.outputs.judgels-server == '1' | |
run: ./judgels-backends/gradlew -p judgels-backends/judgels-server-api check | |
- name: Test judgels-server-app | |
if: steps.changed-files.outputs.judgels-server == '1' | |
run: ./judgels-backends/gradlew -p judgels-backends/judgels-server-app check | |
- name: Set up node | |
if: steps.changed-files.outputs.yarn == '1' | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "20" | |
- name: Get yarn cache directory path | |
if: steps.changed-files.outputs.yarn == '1' | |
id: yarn-cache-dir-path | |
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | |
- name: Use yarn cache | |
if: steps.changed-files.outputs.yarn == '1' | |
uses: actions/cache@v3 | |
id: yarn-cache | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Test judgels-client | |
if: steps.changed-files.outputs.judgels-client == '1' | |
run: | | |
cd judgels-client | |
export NODE_OPTIONS="--max-old-space-size=4096" | |
yarn install | |
yarn ci | |
build: | |
needs: test | |
if: github.ref == 'refs/heads/master' && github.repository_owner == 'ia-toki' | |
runs-on: ubuntu-22.04 | |
env: | |
CONTAINER_REGISTRY_USERNAME: ${{ secrets.CONTAINER_REGISTRY_USERNAME }} | |
CONTAINER_REGISTRY_TOKEN: ${{ secrets.CONTAINER_REGISTRY_TOKEN }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 50 | |
- name: Install docker for ansible | |
run: | | |
ansible-galaxy collection install community.docker:3.10.2 | |
pipx inject ansible-core docker six | |
- id: changed-files | |
name: Check changed files | |
run: python3 ci/check-changed-files.py | bash | |
- name: Set up JDK | |
if: steps.changed-files.outputs.gradle == '1' | |
uses: actions/setup-java@v4 | |
with: | |
distribution: zulu | |
java-version: "11" | |
cache: gradle | |
- name: Set up node | |
if: steps.changed-files.outputs.yarn == '1' | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "20" | |
- name: Get yarn cache directory path | |
if: steps.changed-files.outputs.yarn == '1' | |
id: yarn-cache-dir-path | |
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | |
- name: Use yarn cache | |
if: steps.changed-files.outputs.yarn == '1' | |
uses: actions/cache@v3 | |
id: yarn-cache | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Build judgels-server | |
if: steps.changed-files.outputs.judgels-server == '1' | |
run: ./deployment/scripts/build_judgels_server.sh | |
- name: Build judgels-client | |
if: steps.changed-files.outputs.judgels-client == '1' | |
run: ./deployment/scripts/build_judgels_client.sh | |
- name: Build judgels-grader | |
if: steps.changed-files.outputs.judgels-grader == '1' | |
run: ./deployment/scripts/build_judgels_grader.sh | |
deploy-web: | |
if: github.ref == 'refs/heads/master' && github.repository_owner == 'ia-toki' | |
runs-on: ubuntu-22.04 | |
env: | |
WEB_HOST: ${{ secrets.WEB_HOST }} | |
WEB_KNOWN_HOSTS: ${{ secrets.WEB_KNOWN_HOSTS }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 50 | |
- id: changed-files | |
name: Check changed files | |
run: python3 ci/check-changed-files.py | bash | |
- name: Set up node | |
if: steps.changed-files.outputs.web == '1' | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "20" | |
- name: Build web | |
if: steps.changed-files.outputs.web == '1' | |
run: | | |
cd web | |
yarn install | |
yarn build | |
- name: Install SSH key | |
if: steps.changed-files.outputs.web == '1' | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{ secrets.WEB_PRIVATE_KEY }} | |
known_hosts: ${{ secrets.WEB_KNOWN_HOSTS }} | |
- name: Rsync web | |
if: steps.changed-files.outputs.web == '1' | |
run: rsync -avzh web/build/ root@${WEB_HOST}:/var/www/html/judgels --delete | |
deploy-tlx-staging: | |
needs: build | |
if: github.ref == 'refs/heads/master' && github.repository_owner == 'ia-toki' | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 50 | |
- name: Check out deployment repository | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ secrets.TLX_STAGING_DEPLOYMENT_REPOSITORY }} | |
token: ${{ secrets.TLX_STAGING_DEPLOYMENT_TOKEN }} | |
path: deployment/ansible/env | |
- name: Prepare staging environment SSH key | |
run: chmod 600 deployment/ansible/env/deployment_rsa | |
- id: changed-files | |
name: Check changed files | |
run: python3 ci/check-changed-files.py | bash | |
- name: Deploy judgels-server | |
if: steps.changed-files.outputs.judgels-server == '1' | |
run: | | |
eval "$(ssh-agent -s)" | |
ssh-add deployment/ansible/env/deployment_rsa | |
./deployment/scripts/deploy_judgels_server.sh | |
- name: Deploy judgels-client | |
if: steps.changed-files.outputs.judgels-client == '1' | |
run: | | |
eval "$(ssh-agent -s)" | |
ssh-add deployment/ansible/env/deployment_rsa | |
./deployment/scripts/deploy_judgels_client.sh | |
- name: Deploy judgels-grader | |
if: steps.changed-files.outputs.judgels-grader == '1' | |
run: | | |
eval "$(ssh-agent -s)" | |
ssh-add deployment/ansible/env/deployment_rsa | |
./deployment/scripts/deploy_judgels_grader.sh |