From 39ae0e3742371f33abce9601967b4f45818cbae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Mon, 18 Mar 2024 10:34:00 +0100 Subject: [PATCH] chore(ci): update some actions version (#106) * ci: update some actions version * ci: format yaml --- .github/actions/phar/action.yaml | 46 +++++++++--------- .github/workflows/build-phar.yml | 32 ++++++------- .github/workflows/ci.yml | 62 ++++++++++++------------ .github/workflows/ghpages.yaml | 81 ++++++++++++++++---------------- .github/workflows/release.yml | 48 +++++++++---------- 5 files changed, 134 insertions(+), 135 deletions(-) diff --git a/.github/actions/phar/action.yaml b/.github/actions/phar/action.yaml index 33e0c2c..df8c793 100644 --- a/.github/actions/phar/action.yaml +++ b/.github/actions/phar/action.yaml @@ -1,29 +1,29 @@ -name: 'Build the PHAR' -description: 'Build the PHAR for the current commit' +name: "Build the PHAR" +description: "Build the PHAR for the current commit" runs: - using: "composite" - steps: - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.1' + using: "composite" + steps: + - name: Setup PHP + uses: shivammathur/setup-php@v4 + with: + php-version: "8.1" - - name: Install dependencies (lib) - run: composer install --prefer-dist --no-progress --no-dev --optimize-autoloader --classmap-authoritative - shell: bash + - name: Install dependencies (lib) + run: composer install --prefer-dist --no-progress --no-dev --optimize-autoloader --classmap-authoritative + shell: bash - - name: Install dependencies (PHAR builder) - run: composer install --prefer-dist --no-progress --optimize-autoloader --classmap-authoritative - shell: bash - working-directory: tools/phar + - name: Install dependencies (PHAR builder) + run: composer install --prefer-dist --no-progress --optimize-autoloader --classmap-authoritative + shell: bash + working-directory: tools/phar - - name: Compile PHAR - run: vendor/bin/box compile - shell: bash - working-directory: tools/phar + - name: Compile PHAR + run: vendor/bin/box compile + shell: bash + working-directory: tools/phar - - name: Ensure PHAR is OK - run: build/jolitypo.phar --version - shell: bash - working-directory: tools/phar + - name: Ensure PHAR is OK + run: build/jolitypo.phar --version + shell: bash + working-directory: tools/phar diff --git a/.github/workflows/build-phar.yml b/.github/workflows/build-phar.yml index 3986732..a55473b 100644 --- a/.github/workflows/build-phar.yml +++ b/.github/workflows/build-phar.yml @@ -1,26 +1,26 @@ name: Build the PHAR on: - push: - branches: [ "main" ] + push: + branches: ["main"] permissions: - contents: read + contents: read jobs: - phar: - name: Create a PHAR and upload it as an artifact - runs-on: ubuntu-latest + phar: + name: Create a PHAR and upload it as an artifact + runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 + steps: + - uses: actions/checkout@v4 - - name: Build the PHAR - uses: ./.github/actions/phar + - name: Build the PHAR + uses: ./.github/actions/phar - - name: Upload the PHAR - uses: actions/upload-artifact@v3 - with: - name: 'jolitypo' - path: tools/phar/build/jolitypo.phar - if-no-files-found: error + - name: Upload the PHAR + uses: actions/upload-artifact@v4 + with: + name: "jolitypo" + path: tools/phar/build/jolitypo.phar + if-no-files-found: error diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 51f4a4a..48cdd28 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,40 +1,40 @@ name: Continuous Integration -'on': - push: - branches: - - master - pull_request: ~ +"on": + push: + branches: + - master + pull_request: ~ jobs: - ci: - name: Test PHP ${{ matrix.php-version }} ${{ matrix.name }} - runs-on: ubuntu-latest - strategy: - matrix: - php-version: - - '8.2' - - '8.3' - composer-flags: [''] - name: [''] - include: - - php-version: 8.1 - composer-flags: '--prefer-lowest' - name: '(prefer lowest dependencies)' + ci: + name: Test PHP ${{ matrix.php-version }} ${{ matrix.name }} + runs-on: ubuntu-latest + strategy: + matrix: + php-version: + - "8.2" + - "8.3" + composer-flags: [""] + name: [""] + include: + - php-version: 8.1 + composer-flags: "--prefer-lowest" + name: "(prefer lowest dependencies)" - steps: - - uses: actions/checkout@v3 + steps: + - uses: actions/checkout@v4 - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '${{ matrix.php-version }}' + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "${{ matrix.php-version }}" - - name: Validate composer.json and composer.lock - run: composer validate --strict + - name: Validate composer.json and composer.lock + run: composer validate --strict - - name: Install dependencies - run: composer install --prefer-dist --no-progress + - name: Install dependencies + run: composer install --prefer-dist --no-progress - - name: Run tests - run: composer test + - name: Run tests + run: composer test diff --git a/.github/workflows/ghpages.yaml b/.github/workflows/ghpages.yaml index 78ed6ed..fcfc95e 100644 --- a/.github/workflows/ghpages.yaml +++ b/.github/workflows/ghpages.yaml @@ -1,48 +1,47 @@ - name: Build the public website, and publish to GitHub Pages on: - push: - branches: [ "main" ] + push: + branches: ["main"] permissions: - contents: read - pages: write - id-token: write + contents: read + pages: write + id-token: write jobs: - deploy: - runs-on: ubuntu-latest - environment: - name: github-pages - url: ${{steps.deployment.outputs.page_url}} - steps: - - name: Setup Pages - uses: actions/configure-pages@v3 - - - name: Checkout - uses: actions/checkout@v4 - - - name: Install PHP - uses: shivammathur/setup-php@v2 - with: - php-version: "8.3" - tools: castor - - - name: Build - run: | - set -x - castor website:install - castor website:wasm:export --pack --build - working-directory: ./website - env: - BASE_URL: "/${{ github.event.repository.name }}" - - - name: Upload Artifact - uses: actions/upload-pages-artifact@v2 - with: - path: 'website/public' - - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v2 + deploy: + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{steps.deployment.outputs.page_url}} + steps: + - name: Setup Pages + uses: actions/configure-pages@v4 + + - name: Checkout + uses: actions/checkout@v4 + + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "8.3" + tools: castor + + - name: Build + run: | + set -x + castor website:install + castor website:wasm:export --pack --build + working-directory: ./website + env: + BASE_URL: "/${{ github.event.repository.name }}" + + - name: Upload Artifact + uses: actions/upload-pages-artifact@v4 + with: + path: "website/public" + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1e80a17..002c01e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,35 +1,35 @@ name: Attach PHAR to the release on: - release: - types: [created] + release: + types: [created] permissions: - contents: write + contents: write jobs: - phar_release: - name: Create a PHAR and upload it - runs-on: ubuntu-latest + phar_release: + name: Create a PHAR and upload it + runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 + steps: + - uses: actions/checkout@v4 - - name: Build the PHAR - uses: ./.github/actions/phar + - name: Build the PHAR + uses: ./.github/actions/phar - - name: Get release - id: get_release - uses: bruceadams/get-release@v1.3.2 - env: - GITHUB_TOKEN: ${{ github.token }} + - name: Get release + id: get_release + uses: bruceadams/get-release@v1.3.2 + env: + GITHUB_TOKEN: ${{ github.token }} - - name: Upload release binary - uses: actions/upload-release-asset@v1.0.2 - env: - GITHUB_TOKEN: ${{ github.token }} - with: - upload_url: ${{ steps.get_release.outputs.upload_url }} - asset_path: ./tools/phar/build/jolitypo.phar - asset_name: jolitypo.phar - asset_content_type: application/octet-stream + - name: Upload release binary + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + upload_url: ${{ steps.get_release.outputs.upload_url }} + asset_path: ./tools/phar/build/jolitypo.phar + asset_name: jolitypo.phar + asset_content_type: application/octet-stream