diff --git a/.github/actions/be/action.yml b/.github/actions/be/action.yml index 512c6d57..aacfb6d5 100644 --- a/.github/actions/be/action.yml +++ b/.github/actions/be/action.yml @@ -15,10 +15,12 @@ runs: ini-values: opcache.enable_cli=1 env: # https://github.com/shivammathur/setup-php/blob/6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d/README.md#force-update-setup update: 'true' - # https://github.com/shivammathur/setup-php/blob/6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d/README.md#cache-composer-dependencies + # https://github.com/shivammathur/setup-php/blob/6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d/README.md#problem-matchers - run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" working-directory: be shell: bash + # https://github.com/shivammathur/setup-php/blob/6d7209f44a25a59e904b1ee9f3b0c33ab2cd888d/README.md#cache-composer-dependencies + # https://github.com/actions/cache/blob/a2ed59d39b352305bdd2f628719a53b2cc4f9613/examples.md#php---composer - id: composer-cache run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT working-directory: be @@ -26,8 +28,14 @@ runs: - uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('be/composer.lock') }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} restore-keys: ${{ runner.os }}-composer- - run: composer install --prefer-dist working-directory: be shell: bash + # https://github.com/actions/runner/issues/1478 + # https://github.com/actions/setup-node/issues/410#issuecomment-1939482965 + - uses: actions/cache/save@v4 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} diff --git a/.github/actions/c#/action.yml b/.github/actions/c#/action.yml index e6686bd4..cf4b4e08 100644 --- a/.github/actions/c#/action.yml +++ b/.github/actions/c#/action.yml @@ -9,12 +9,25 @@ runs: - uses: actions/setup-dotnet@v4 with: # https://github.com/actions/setup-dotnet/tree/v4 dotnet-version: 7 - cache: true - # https://github.com/actions/setup-node/issues/624#issuecomment-1328681525 - cache-dependency-path: ${{ github.workspace }}/c#/*/packages.lock.json + # cache: true + # # https://github.com/actions/setup-node/issues/624#issuecomment-1328681525 + # cache-dependency-path: ${{ github.workspace }}/c#/*/packages.lock.json + # in favor of https://github.com/actions/cache/blob/a2ed59d39b352305bdd2f628719a53b2cc4f9613/examples.md#c---nuget + # to allow saving cache even jobs failed + - uses: actions/cache@v4 + with: + path: ~/.nuget/packages + key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} + restore-keys: ${{ runner.os }}-nuget- - run: dotnet new globaljson --sdk-version 7.0.405 working-directory: c# shell: bash - run: dotnet restore working-directory: c# shell: bash + # https://github.com/actions/runner/issues/1478 + # https://github.com/actions/setup-node/issues/410#issuecomment-1939482965 + - uses: actions/cache/save@v4 + with: + path: ~/.nuget/packages + key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} diff --git a/.github/actions/fe/action.yml b/.github/actions/fe/action.yml index 546d7ec2..d7b5cf0c 100644 --- a/.github/actions/fe/action.yml +++ b/.github/actions/fe/action.yml @@ -7,10 +7,26 @@ runs: - uses: actions/setup-node@v4 with: # https://github.com/actions/setup-node/tree/v4 node-version: lts/* - cache: yarn - # https://github.com/actions/setup-node/issues/624#issuecomment-1328681525 - cache-dependency-path: ${{ github.workspace }}/fe/yarn.lock - - name: install - run: yarn install --immutable + # cache: yarn + # # https://github.com/actions/setup-node/issues/624#issuecomment-1328681525 + # cache-dependency-path: ${{ github.workspace }}/fe/yarn.lock + # in favor of https://github.com/actions/cache/blob/a2ed59d39b352305bdd2f628719a53b2cc4f9613/examples.md#node---yarn-2 + # to allow saving cache even jobs failed + - id: yarn-cache-dir-path + run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT working-directory: fe shell: bash + - uses: actions/cache@v3 + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: ${{ runner.os }}-yarn- + - run: yarn install --immutable + working-directory: fe + shell: bash + # https://github.com/actions/runner/issues/1478 + # https://github.com/actions/setup-node/issues/410#issuecomment-1939482965 + - uses: actions/cache/save@v4 + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} diff --git a/.github/workflows/fe.yml b/.github/workflows/fe.yml index 33273113..ebcf29ed 100644 --- a/.github/workflows/fe.yml +++ b/.github/workflows/fe.yml @@ -1,7 +1,7 @@ name: fe on: push: - paths: [fe/**] + #paths: [fe/**] defaults: run: working-directory: fe