diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 174d44f296..cb3e251706 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -17,3 +17,8 @@ updates: directory: / schedule: interval: daily + + - package-ecosystem: github-actions + directory: / + schedule: + interval: daily diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index cf05c4152a..dddd589319 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -30,6 +30,20 @@ jobs: key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- + - name: Restore PHP_CodeSniffer cache + uses: actions/cache@v3 + with: + path: ${{ runner.temp }}/phpcs + key: ${{ runner.os }}-phpcs-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-phpcs- + + - name: Restore PHPStan cache + uses: actions/cache@v3 + with: + path: ${{ runner.temp }}/phpcs + key: ${{ runner.os }}-phpstan-${{ hashFiles('**/composer.lock') }} + restore-keys: ${{ runner.os }}-phpstan- + - name: Install Composer dependencies run: > composer install \ @@ -39,12 +53,33 @@ jobs: - name: Run PHP_CodeSniffer if: always() - run: ./vendor/bin/phpcs -q --report=checkstyle | cs2pr --graceful-warnings + run: > + ./vendor/bin/phpcs \ + -q \ + --cache=${{ runner.temp }}/phpcs \ + --report=checkstyle \ + | cs2pr --graceful-warnings + + - name: Save PHP_CodeSniffer cache + uses: actions/cache/save@v3 + if: always() + with: + path: ${{ runner.temp }}/phpcs + key: ${{ runner.os }}-phpcs-${{ hashFiles('**/composer.lock') }} - name: Run PHPStan if: always() + env: + PHPSTAN_TMP_DIR: ${{ runner.temp }}/phpstan run: ./vendor/bin/phpstan analyse --error-format=github --no-progress + - name: Save PHPStan cache + uses: actions/cache/save@v3 + if: always() + with: + path: ${{ runner.temp }}/phpstan + key: ${{ runner.os }}-phpstan-${{ hashFiles('**/composer.lock') }} + test: name: Test runs-on: ubuntu-latest diff --git a/config/autoload/cron.global.php b/config/autoload/cron.global.php index b214bddc42..1857f3c4a1 100644 --- a/config/autoload/cron.global.php +++ b/config/autoload/cron.global.php @@ -18,7 +18,7 @@ array( 'command' => 'php bin/console.php form:reminders -m', 'schedule' => '0 2 * * *', - ) + ), ), ), ); diff --git a/config/autoload/database.global.php b/config/autoload/database.global.php index 50421bd180..9eb040a483 100644 --- a/config/autoload/database.global.php +++ b/config/autoload/database.global.php @@ -56,7 +56,7 @@ 'directory' => __DIR__ . '/../../migrations', 'namespace' => 'Migrations', 'table' => 'general_migrations', - 'custom_template' => __DIR__ . '/../../migrations/migration.tpl' + 'custom_template' => __DIR__ . '/../../migrations/migration.tpl', ), ), ), diff --git a/config/autoload/google.global.php b/config/autoload/google.global.php index 52ddfa0296..34d97b35e2 100644 --- a/config/autoload/google.global.php +++ b/config/autoload/google.global.php @@ -20,7 +20,7 @@ 'client_email' => $_ENV['LITUS_GOOGLE_CLIENT_EMAIL'], 'client_id' => $_ENV['LITUS_GOOGLE_CLIENT_ID'], 'client_x509_cert_url' => $_ENV['LITUS_GOOGLE_CLIENT_X509_CERT_URL'], - ) + ), ); } diff --git a/migrations/Version20220131125347.php b/migrations/Version20220131125347.php index 0c06d89526..058c94c42c 100644 --- a/migrations/Version20220131125347.php +++ b/migrations/Version20220131125347.php @@ -52,7 +52,7 @@ public function up(Schema $schema) : void $this->addSql('ALTER TABLE br_match ADD CONSTRAINT FK_CDBA31974FBF094F FOREIGN KEY (company) REFERENCES br_match_matchee_map_company (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE br_match ADD CONSTRAINT FK_CDBA3197B723AF33 FOREIGN KEY (student) REFERENCES br_match_matchee_map_student (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE br_match ADD CONSTRAINT FK_CDBA3197DA04AD89 FOREIGN KEY (wave) REFERENCES br_match_companywave_match_map (id) ON DELETE SET NULL NOT DEFERRABLE INITIALLY IMMEDIATE'); - } + } /** * @param \Doctrine\DBAL\Schema\Schema $schema diff --git a/migrations/Version20230319225809.php b/migrations/Version20230319225809.php index ceb1b5d0c5..cd09517b23 100644 --- a/migrations/Version20230319225809.php +++ b/migrations/Version20230319225809.php @@ -19,7 +19,6 @@ public function up(Schema $schema) : void $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); $this->addSql('ALTER TABLE logistics_inventory ADD category VARCHAR(255) DEFAULT NULL'); - } /** diff --git a/migrations/Version20230825112313.php b/migrations/Version20230825112313.php index 11ba4505b1..181252bd9a 100644 --- a/migrations/Version20230825112313.php +++ b/migrations/Version20230825112313.php @@ -19,7 +19,6 @@ public function up(Schema $schema) : void $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); $this->addSql('ALTER TABLE nodes_events ADD is_career BOOLEAN DEFAULT \'false\''); - } /** diff --git a/migrations/Version20230905185405.php b/migrations/Version20230905185405.php index 5b7f230b2d..551d8d5bcd 100644 --- a/migrations/Version20230905185405.php +++ b/migrations/Version20230905185405.php @@ -20,13 +20,13 @@ public function up(Schema $schema) : void $this->addSql('CREATE SEQUENCE shop_sessions_messages_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); $this->addSql('CREATE SEQUENCE shop_sessions_messages_translations_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); - $this->addSql('CREATE TABLE shop_sessions_messages (id BIGINT NOT NULL, creation_time TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, active BOOLEAN NOT NULL, PRIMARY KEY(id))'); + $this->addSql('CREATE TABLE shop_sessions_messages (id BIGINT NOT NULL, creation_time TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, active BOOLEAN NOT NULL, PRIMARY KEY(id))'); $this->addSql('CREATE TABLE shop_sessions_messages_translations (id BIGINT NOT NULL, message BIGINT DEFAULT NULL, language BIGINT DEFAULT NULL, content VARCHAR(255) NOT NULL, PRIMARY KEY(id))'); $this->addSql('CREATE INDEX IDX_D38ABBADB6BD307F ON shop_sessions_messages_translations (message)'); $this->addSql('CREATE INDEX IDX_D38ABBADD4DB71B5 ON shop_sessions_messages_translations (language)'); - $this->addSql('ALTER TABLE shop_sessions_messages_translations ADD CONSTRAINT FK_D38ABBADB6BD307F FOREIGN KEY (message) REFERENCES shop_sessions_messages (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); + $this->addSql('ALTER TABLE shop_sessions_messages_translations ADD CONSTRAINT FK_D38ABBADB6BD307F FOREIGN KEY (message) REFERENCES shop_sessions_messages (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); $this->addSql('ALTER TABLE shop_sessions_messages_translations ADD CONSTRAINT FK_D38ABBADD4DB71B5 FOREIGN KEY (language) REFERENCES general_languages (id) NOT DEFERRABLE INITIALLY IMMEDIATE'); - } + } /** * @param \Doctrine\DBAL\Schema\Schema $schema diff --git a/phpstan.neon b/phpstan.neon index 915ee8811e..3701b56348 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,5 +1,7 @@ +includes: + - phpstan.neon.php + parameters: - tmpDir: phpstan/ level: 1 paths: - bin/ diff --git a/phpstan.neon.php b/phpstan.neon.php new file mode 100644 index 0000000000..729f121811 --- /dev/null +++ b/phpstan.neon.php @@ -0,0 +1,7 @@ + array( + 'tmpDir' => getenv("PHPSTAN_TMP_DIR", true) ?: "", + ), +);