Merge pull request #76 from luckylat/editorconfig #118
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: verify | |
on: | |
push: | |
branches: | |
- "main" | |
workflow_dispatch: | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Allow one concurrent deployment | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up competitive-verifier | |
uses: competitive-verifier/actions/setup@v1 | |
with: | |
cache-pip: true | |
# Initialize your own environment for resolving. | |
# required only if you set `languages.rust.list_dependencies_backend.kind` to `"cargo-udeps"` | |
# - name: Set up Rust (nightly) | |
# uses: dtolnay/rust-toolchain@stable | |
# with: | |
# toolchain: nightly | |
# targets: x86_64-unknown-linux-gnu | |
# - name: Install cargo-udeps for Rust | |
# uses: baptiste0928/cargo-install@v2 | |
# with: | |
# crate: cargo-udeps | |
# cache-key: cargo-udeps-key | |
- name: oj-resolve | |
uses: competitive-verifier/actions/oj-resolve@v1 | |
with: | |
output-path: verify_files.json | |
# Specify patterns | |
# include: your-own-include/ | |
exclude: | | |
ac-library/ | |
# If you have config.toml | |
config: .competitive-verifier/config.toml | |
- name: parse-doxygen | |
uses: competitive-verifier/actions/parse-doxygen@v1 | |
with: | |
verify-files: verify_files.json | |
- name: Upload verify_files.json | |
uses: competitive-verifier/actions/upload-verify-artifact@v1 | |
with: | |
file: verify_files.json | |
- name: Check bundled | |
id: test-bundled | |
run: | | |
echo "count=$(find .competitive-verifier/bundled/ -type f | wc -l)" >> $GITHUB_OUTPUT | |
- name: Upload bundled | |
uses: actions/upload-artifact@v3 | |
if: steps.test-bundled.outputs.count > 0 | |
with: | |
name: Bundled-${{ runner.os }} | |
path: .competitive-verifier/bundled | |
retention-days: 1 | |
verify: | |
runs-on: ubuntu-latest | |
needs: [setup] | |
env: | |
SPLIT_SIZE: "20" | |
strategy: | |
matrix: | |
# prettier-ignore | |
index: | |
["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", | |
"10", "11", "12", "13", "14", "15", "16", "17", "18", "19"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download verify_files.json | |
uses: competitive-verifier/actions/download-verify-artifact@v1 | |
- name: Set up competitive-verifier | |
uses: competitive-verifier/actions/setup@v1 | |
with: | |
cache-pip: true | |
# Initialize your own environment for verification. | |
- name: Install dependencies (Go) | |
uses: actions/setup-go@v4 | |
- name: Install dependencies (Haskell) | |
uses: haskell/actions/setup@v2 | |
# - name: Set up Rust (1.42.0) | |
# uses: dtolnay/rust-toolchain@stable | |
# with: | |
# toolchain: "1.42.0" | |
# targets: x86_64-unknown-linux-gnu | |
- name: Verify | |
uses: competitive-verifier/actions/verify@v1 | |
with: | |
destination: ${{runner.temp}}/result.json | |
split-size: ${{ env.SPLIT_SIZE }} | |
split-index: ${{ matrix.index }} | |
timeout: 1800 | |
env: | |
YUKICODER_TOKEN: ${{secrets.YUKICODER_TOKEN}} | |
- name: Upload result artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Result-${{ runner.os }}-${{ matrix.index }} | |
path: ${{runner.temp}}/result.json | |
retention-days: 1 | |
docs-and-check: | |
runs-on: ubuntu-latest | |
needs: [verify] | |
outputs: | |
upload-pages: ${{steps.upload-pages.outcome == 'success'}} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2147483647 | |
- name: Download verify_files.json and all artifacts | |
id: all-artifacts | |
uses: competitive-verifier/actions/download-verify-artifact@v1 | |
with: | |
download-all: true | |
artifact-root: .artifacts/ | |
- name: Extract bundled | |
shell: bash | |
run: | | |
rm -rf .competitive-verifier/bundled | |
if test -d "$SRCDIR"; then | |
mkdir -p .competitive-verifier/ | |
mv "$SRCDIR" .competitive-verifier/bundled | |
else | |
echo "$SRCDIR does not exist." | |
fi | |
env: | |
SRCDIR: .artifacts/Bundled-${{ runner.os }} | |
- name: Set up competitive-verifier | |
uses: competitive-verifier/actions/setup@v1 | |
with: | |
cache-pip: true | |
- name: Docs | |
uses: competitive-verifier/actions/docs@v1 | |
with: | |
verify-result: ${{ steps.all-artifacts.outputs.artifacts-root }}/Result-*/result.json | |
destination: _jekyll | |
write-summary: true | |
- name: Setup Pages | |
uses: actions/configure-pages@v3 | |
- name: Build with Jekyll | |
uses: actions/jekyll-build-pages@v1 | |
with: | |
source: _jekyll | |
destination: _site | |
- name: Upload artifact | |
id: upload-pages | |
uses: actions/upload-pages-artifact@v2 | |
with: | |
path: _site | |
- name: Check | |
uses: competitive-verifier/actions/check@v1 | |
with: | |
verify-result: ${{ steps.all-artifacts.outputs.artifacts-root }}/Result-*/result.json | |
deploy: | |
if: (success() || failure()) && github.ref == 'refs/heads/main' && needs.docs-and-check.outputs.upload-pages == 'true' | |
needs: docs-and-check | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |