From 2d0dbe5693648613bc4c4c6444eb1e79bdc77334 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Wed, 21 Sep 2022 22:42:10 +0200 Subject: [PATCH] Bump actions --- .github/workflows/documentation.yml | 53 +++++++++++++++++++++++++++++ .github/workflows/php.yml | 33 +++++++++--------- 2 files changed, 69 insertions(+), 17 deletions(-) create mode 100644 .github/workflows/documentation.yml diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 0000000..16bfce3 --- /dev/null +++ b/.github/workflows/documentation.yml @@ -0,0 +1,53 @@ +name: Documentation + +on: + push: + branches: [ master, simplesamlphp-* ] + paths: + - '**.md' + pull_request: + branches: [ master, simplesamlphp-* ] + paths: + - '**.md' + +jobs: + quality: + name: Quality checks + runs-on: [ubuntu-latest] + + steps: + - uses: actions/checkout@v3 + + - name: Lint markdown files + uses: nosborn/github-action-markdown-cli@v3.1.0 + with: + files: . + ignore_path: .markdownlintignore + + - name: Perform spell check + uses: codespell-project/actions-codespell@master + with: + path: '**/*.md' + check_filenames: true + ignore_words_list: tekst + + build: + name: Build documentation + needs: quality + runs-on: [ubuntu-latest] + + steps: + - name: Run docs build + if: github.event_name != 'pull_request' + uses: actions/github-script@v6 + with: + # Token has to be generated on a user account that controls the docs-repository. + # The _only_ scope to select is "Access public repositories", nothing more. + github-token: ${{ secrets.PAT_TOKEN }} + script: | + await github.rest.actions.createWorkflowDispatch({ + owner: 'simplesamlphp', + repo: 'docs', + workflow_id: 'mk_docs.yml', + ref: 'main' + }) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 06a2128..f61ff9d 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -3,8 +3,12 @@ name: CI on: push: branches: [ '**' ] + paths-ignore: + - '**.md' pull_request: branches: [ master, release-* ] + paths-ignore: + - '**.md' jobs: basic-tests: @@ -37,14 +41,14 @@ jobs: git config --global core.autocrlf false git config --global core.eol lf - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} @@ -91,14 +95,14 @@ jobs: - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} @@ -132,14 +136,14 @@ jobs: - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} @@ -161,6 +165,7 @@ jobs: steps: - name: Setup PHP, with composer and extensions + id: setup-php uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php with: php-version: '7.4' @@ -170,14 +175,14 @@ jobs: - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} @@ -192,7 +197,7 @@ jobs: path: ${{ github.workspace }}/build - name: Codecov - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v3 - name: PHP Code Sniffer continue-on-error: true @@ -200,14 +205,8 @@ jobs: - name: Psalm continue-on-error: true - run: php vendor/bin/psalm --show-info=true --shepherd + run: php vendor/bin/psalm --show-info=true --shepherd --php-version=${{ steps.setup-php.outputs.php-version }} - name: Psalter continue-on-error: true - run: php vendor/bin/psalter --issues=UnnecessaryVarAnnotation --dry-run - - - name: Lint markdown files - uses: nosborn/github-action-markdown-cli@v3.0.1 - with: - files: . - ignore_path: .markdownlintignore + run: php vendor/bin/psalter --issues=UnnecessaryVarAnnotation --dry-run --php-version=${{ steps.setup-php.outputs.php-version }}