From 5535b716a80baee817e13690c79ea24db72eaa54 Mon Sep 17 00:00:00 2001 From: Michael Vasseur <14887731+vmcj@users.noreply.github.com> Date: Tue, 20 Feb 2024 19:10:45 +0100 Subject: [PATCH] Ignore other tests --- .../autoconf-check-different-distro.yml | 26 ----- .github/workflows/autoconf-check.yml | 38 -------- .github/workflows/codeql-analysis.yml | 95 ------------------- .github/workflows/codespell.yml | 27 ------ .github/workflows/codestyle.yml | 71 -------------- .github/workflows/mayhem-api-template.yml | 93 ------------------ .github/workflows/mayhem-daily.yml | 14 --- .github/workflows/mayhem-weekly.yml | 25 ----- .github/workflows/phpcodesniffer.yml | 32 ------- .github/workflows/phpstan.yml | 23 ----- .github/workflows/runpipe.yml | 30 ------ .github/workflows/shiftleft.yml | 31 ------ .github/workflows/unit-tests.yml | 21 ---- .gitlab-ci.yml | 16 ---- 14 files changed, 542 deletions(-) delete mode 100644 .github/workflows/autoconf-check-different-distro.yml delete mode 100644 .github/workflows/autoconf-check.yml delete mode 100644 .github/workflows/codeql-analysis.yml delete mode 100644 .github/workflows/codespell.yml delete mode 100644 .github/workflows/codestyle.yml delete mode 100644 .github/workflows/mayhem-api-template.yml delete mode 100644 .github/workflows/mayhem-daily.yml delete mode 100644 .github/workflows/mayhem-weekly.yml delete mode 100644 .github/workflows/phpcodesniffer.yml delete mode 100644 .github/workflows/phpstan.yml delete mode 100644 .github/workflows/runpipe.yml delete mode 100644 .github/workflows/shiftleft.yml delete mode 100644 .github/workflows/unit-tests.yml delete mode 100644 .gitlab-ci.yml diff --git a/.github/workflows/autoconf-check-different-distro.yml b/.github/workflows/autoconf-check-different-distro.yml deleted file mode 100644 index 6c0cefc5b4b..00000000000 --- a/.github/workflows/autoconf-check-different-distro.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Check autoconf (Other distros) -on: - push: - branches: - - main - - '[0-9]+.[0-9]+' - pull_request: - branches: - - main - - '[0-9]+.[0-9]+' - -jobs: - redhat-family: - strategy: - matrix: - version: [latest] - os: [fedora] - runs-on: ubuntu-latest - container: - image: ${{ matrix.os }}:${{ matrix.version }} - steps: - - name: Install git so we get the .github directory - run: dnf install -y git - - uses: actions/checkout@v3 - - name: Setup image and run bats tests - run: .github/jobs/configure-checks/setup_configure_image.sh diff --git a/.github/workflows/autoconf-check.yml b/.github/workflows/autoconf-check.yml deleted file mode 100644 index 5f8ed73f6b5..00000000000 --- a/.github/workflows/autoconf-check.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Check autoconf -on: - push: - branches: - - main - - '[0-9]+.[0-9]+' - pull_request: - branches: - - main - - '[0-9]+.[0-9]+' - -jobs: - debian-family: - strategy: - matrix: - version: [jammy, focal, rolling] - os: [ubuntu] - releaseBranch: - - ${{ contains(github.ref, 'main') }} - exclude: - - releaseBranch: false - include: - - os: debian - version: testing - - os: debian - version: stable - runs-on: ubuntu-latest - env: - DEBIAN_FRONTEND: noninteractive - TZ: Etc/UTC - container: - image: ${{ matrix.os }}:${{ matrix.version }} - steps: - - name: Install git so we get the .github directory - run: apt-get update; apt-get install -y git - - uses: actions/checkout@v3 - - name: Setup image and run bats tests - run: .github/jobs/configure-checks/setup_configure_image.sh diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index b4c717d39a0..00000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,95 +0,0 @@ -name: "CodeQL" - -on: - push: - branches: - - main - - '[0-9]+.[0-9]+' - pull_request: - branches: - - main - - '[0-9]+.[0-9]+' - -jobs: - analyze: - # We can not run with our gitlab container - # CodeQL has missing .so files otherwise - name: Analyze - runs-on: ubuntu-latest - env: - COMPILED: "cpp" - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'cpp', 'java', 'javascript', 'python' ] - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: ${{ matrix.language }} - - - name: Install required tools - if: ${{ contains(env.COMPILED, matrix.language) }} - run: | - sudo apt update - sudo apt install -y acl zip unzip apache2 php php-fpm php-gd \ - php-cli php-intl php-mbstring php-mysql php-curl php-json \ - php-xml php-zip ntp make sudo debootstrap \ - libcgroup-dev lsof php-cli php-curl php-json php-xml \ - php-zip procps gcc g++ default-jre-headless \ - default-jdk-headless ghc fp-compiler autoconf automake bats \ - python3-sphinx python3-sphinx-rtd-theme rst2pdf fontconfig \ - python3-yaml latexmk - php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" - HASH="$(wget -q -O - https://composer.github.io/installer.sig)" - php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" - sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer - - - name: Install composer files - if: ${{ contains(env.COMPILED, matrix.language) }} - run: | - composer install --no-scripts - - - name: Configure Makefile - if: ${{ contains(env.COMPILED, matrix.language) }} - run: | - DIR=$(pwd) - mkdir ./installdir - make configure - ./configure --enable-doc-build=no --prefix=$DIR/installdir - - - name: Compile domserver - if: ${{ contains(env.COMPILED, matrix.language) }} - run: | - make domserver - make install-domserver - - - name: Compile the build scripts for languages - run: | - make build-scripts - - - name: Compile judgehost - if: ${{ contains(env.COMPILED, matrix.language) }} - run: | - make judgehost - sudo make install-judgehost - - - name: Remove upstream code - run: | - rm -rf webapp/public/js/ace doc/manual/_static - - - name: Chown everything to the current runner user - if: ${{ contains(env.COMPILED, matrix.language) }} - run: sudo chown -R ${USER} ./installdir - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml deleted file mode 100644 index 56c2dfac7ff..00000000000 --- a/.github/workflows/codespell.yml +++ /dev/null @@ -1,27 +0,0 @@ -on: - push: - branches: - - main - - '[0-9]+.[0-9]+' - pull_request: - branches: - - main - - '[0-9]+.[0-9]+' - -name: Spell Check - -jobs: - codespell: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Rewrite Changelog to find new mistakes - run: awk '1;/Version 7.2.1 - 6 May 2020/{exit}' ChangeLog > latest_Changelog - - name: Get dirs to skip - id: list_to_csv - run: echo "::set-output name=SKIP::$(awk '{print $1}' .github/jobs/data/codespellignorefiles.txt | paste -s -d, -)" - - uses: codespell-project/actions-codespell@master - with: - check_filenames: true - ignore_words_file: .github/jobs/data/codespellignorewords.txt - skip: ${{ steps.list_to_csv.outputs.SKIP }} diff --git a/.github/workflows/codestyle.yml b/.github/workflows/codestyle.yml deleted file mode 100644 index 9b3edc5990e..00000000000 --- a/.github/workflows/codestyle.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: Codestandard -on: - push: - branches: - - main - - '[0-9]+.[0-9]+' - pull_request: - branches: - - main - - '[0-9]+.[0-9]+' - -jobs: - syntax-job: - runs-on: ubuntu-latest - container: - image: domjudge/gitlabci:2.1 - steps: - - uses: actions/checkout@v3 - - name: Run the syntax checks - run: .github/jobs/syntax.sh - - detect-dump: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: "Search for leftover dump( statements" - run: .github/jobs/detect_dump.sh - - php-linter: - runs-on: ubuntu-latest - container: - image: pipelinecomponents/php-linter:latest - steps: - - uses: actions/checkout@v3 - - name: Detect PHP linting issues - run: > - parallel-lint --colors - lib/lib.*.php - etc - judge - webapp/src - webapp/tests - webapp/public - webapp/config - - phpcs_compatibility: - runs-on: ubuntu-latest - container: - image: pipelinecomponents/php-codesniffer:latest - strategy: - matrix: - PHPVERSION: ["8.1", "8.2"] - steps: - - run: apk add git - - uses: actions/checkout@v3 - - name: Various fixes to this image - run: .github/jobs/fix_pipelinecomponents_image.sh - - name: Detect compatibility with supported PHP version - run: > - phpcs -s -p --colors - --standard=PHPCompatibility - --extensions=php - --runtime-set testVersion ${{ matrix.PHPVERSION }} - lib/lib.*.php - etc - judge - webapp/src - webapp/tests - webapp/public - webapp/config - diff --git a/.github/workflows/mayhem-api-template.yml b/.github/workflows/mayhem-api-template.yml deleted file mode 100644 index 445d6311c66..00000000000 --- a/.github/workflows/mayhem-api-template.yml +++ /dev/null @@ -1,93 +0,0 @@ -name: "Mayhem API analysis (Template)" - -on: - workflow_call: - inputs: - version: - required: true - type: string - duration: - required: true - type: string - secrets: - MAPI_TOKEN: - required: true - -jobs: - mayhem: - name: Mayhem API analysis - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - env: - DB_DATABASE: domjudge - DB_USER: user - DB_PASSWORD: password - steps: - - uses: actions/checkout@v3 - - - name: Install DOMjudge - run: .github/jobs/baseinstall.sh ${{ inputs.version }} - - - name: Dump the OpenAPI - run: .github/jobs/getapi.sh - - - uses: actions/upload-artifact@v3 - if: ${{ inputs.version == 'guest' }} - with: - name: all-apispec - path: | - /home/runner/work/domjudge/domjudge/openapi.json - - - name: Mayhem for API - uses: ForAllSecure/mapi-action@v1 - if: ${{ inputs.version == 'guest' }} - continue-on-error: true - with: - mapi-token: ${{ secrets.MAPI_TOKEN }} - api-url: http://localhost/domjudge - api-spec: http://localhost/domjudge/api/doc.json # swagger/openAPI doc hosted here - duration: "auto" # Only spend time if we need to recheck issues from last time or find issues - sarif-report: mapi.sarif - run-args: | - --config - .github/jobs/data/mapi.config - --ignore-endpoint - ".*strict=true.*" - --ignore-endpoint - ".*strict=True.*" - - - name: Mayhem for API (For application role) - uses: ForAllSecure/mapi-action@v1 - if: ${{ inputs.version != 'guest' }} - continue-on-error: true - with: - mapi-token: ${{ secrets.MAPI_TOKEN }} - target: domjudge-${{ inputs.version }} - api-url: http://localhost/domjudge - api-spec: http://localhost/domjudge/api/doc.json # swagger/openAPI doc hosted here - duration: "${{ inputs.duration }}" - sarif-report: mapi.sarif - run-args: | - --config - .github/jobs/data/mapi.config - --basic-auth - admin:password - --ignore-endpoint - ".*strict=true.*" - --ignore-endpoint - ".*strict=True.*" - - - name: Upload SARIF file - uses: github/codeql-action/upload-sarif@v2 - with: - sarif_file: mapi.sarif - - - uses: actions/upload-artifact@v3 - with: - name: ${{ inputs.version }}-logs - path: | - /var/log/nginx - /opt/domjudge/domserver/webapp/var/log/*.log diff --git a/.github/workflows/mayhem-daily.yml b/.github/workflows/mayhem-daily.yml deleted file mode 100644 index 2118bf6920c..00000000000 --- a/.github/workflows/mayhem-daily.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: "Mayhem API daily (admin role only)" - -on: - schedule: - - cron: '0 23 * * *' - -jobs: - mayhem-template: - uses: ./.github/workflows/mayhem-api-template.yml - with: - version: "admin" - duration: "auto" - secrets: - MAPI_TOKEN: ${{ secrets.MAPI_TOKEN }} diff --git a/.github/workflows/mayhem-weekly.yml b/.github/workflows/mayhem-weekly.yml deleted file mode 100644 index 71cc90ecbaf..00000000000 --- a/.github/workflows/mayhem-weekly.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: "Mayhem API weekly (all roles)" - -on: - schedule: - - cron: '0 23 * * 0' - -jobs: - mayhem-template: - strategy: - matrix: - include: - - version: "team" - duration: "5m" - - version: "guest" - duration: "auto" - - version: "jury" - duration: "5min" - - version: "admin" - duration: "10m" - uses: ./.github/workflows/mayhem-api-template.yml - with: - version: "${{ matrix.version }}" - duration: "${{ matrix.duration }}" - secrets: - MAPI_TOKEN: ${{ secrets.MAPI_TOKEN }} diff --git a/.github/workflows/phpcodesniffer.yml b/.github/workflows/phpcodesniffer.yml deleted file mode 100644 index 49f8f76f697..00000000000 --- a/.github/workflows/phpcodesniffer.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: PHP CodeSniffer - -# Controls when the action will run. -on: - push: - branches: - - main - - '[0-9]+.[0-9]+' - pull_request: - branches: - - main - - '[0-9]+.[0-9]+' -jobs: - phpcs: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 # important! - - name: Install PHP_CodeSniffer - run: | - curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar - php phpcs.phar --version - - - uses: domjudge/action-php-codesniffer@master - with: - files: "**.php" # you may customize glob as needed - scope: files - phpcs_path: php phpcs.phar - standard: .github/jobs/data/phpruleset.xml - fail_on_errors: false - fail_on_warnings: false diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml deleted file mode 100644 index c550309f34e..00000000000 --- a/.github/workflows/phpstan.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Run PHPStan -on: - push: - branches: - - main - - '[0-9]+.[0-9]+' - pull_request: - branches: - - main - - '[0-9]+.[0-9]+' - -jobs: - phpstan: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Install DOMjudge - run: .github/jobs/baseinstall.sh admin - - uses: php-actions/phpstan@v3 - with: - configuration: phpstan.dist.neon - path: webapp/src webapp/tests - php_extensions: gd intl mysqli pcntl zip diff --git a/.github/workflows/runpipe.yml b/.github/workflows/runpipe.yml deleted file mode 100644 index 551b8217576..00000000000 --- a/.github/workflows/runpipe.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Run runpipe tests -on: - push: - branches-ignore: - - main - - '[0-9]+.[0-9]+' - - gh-readonly-queue/main/* - - gh-readonly-queue/main/[0-9]+.[0-9]+ - pull_request: - branches: - - main - - '[0-9]+.[0-9]+' - -jobs: - runpipe: - runs-on: ubuntu-latest - container: - image: domjudge/gitlabci:2.1 - steps: - - uses: actions/checkout@v3 - - name: Create the configure file - run: make configure - - name: Do the default configure - run: ./configure --with-baseurl='http://localhost/domjudge/' --with-domjudge-user=domjudge --with-judgehost_chrootdir=${DIR}/chroot/domjudge - - name: Prepare judgehost files - run: make judgehost - - name: Run the actual runpipe tests - working-directory: judge/runpipe_test - run: make test - diff --git a/.github/workflows/shiftleft.yml b/.github/workflows/shiftleft.yml deleted file mode 100644 index be08719bffe..00000000000 --- a/.github/workflows/shiftleft.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: SL Scan - -on: - push: - branches-ignore: - - main - - '[0-9]+.[0-9]+' - - gh-readonly-queue/main/* - - gh-readonly-queue/main/[0-9]+.[0-9]+ - -jobs: - Scan-Build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Perform Scan - uses: ShiftLeftSecurity/scan-action@master - env: - WORKSPACE: "" - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SCAN_AUTO_BUILD: true - SCAN_ANNOTATE_PR: 0 - with: - output: reports - type: python,bash - - - name: Upload report - uses: github/codeql-action/upload-sarif@v2 - with: - sarif_file: reports diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml deleted file mode 100644 index c4119722b7d..00000000000 --- a/.github/workflows/unit-tests.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Unit tests -on: - push: - branches: - - main - - '[0-9]+.[0-9]+' - pull_request: - branches: - - main - - '[0-9]+.[0-9]+' - -jobs: - check-static-codecov: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Download latest codecov upload script - run: wget https://codecov.io/bash -O newcodecov - - name: Detect changes to manually verify - run: diff newcodecov .github/jobs/uploadcodecov.sh - diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 54ab02e9057..00000000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,16 +0,0 @@ -include: - - '/gitlab/ci/unit.yml' - - '/gitlab/ci/integration.yml' - - '/gitlab/ci/webstandard.yml' - - '/gitlab/ci/template.yml' - -stages: - - test - - integration - - accessibility - - chroot_checks - - unit - - style - - ci_checks - -image: domjudge/gitlabci:22.04