|
1 | 1 | name: Continuous Integration
|
2 | 2 | on:
|
3 | 3 | push:
|
| 4 | + branches: |
| 5 | + - 'main' |
| 6 | + - 'master' |
| 7 | + - 'refs/heads/v[0-9]+.[0-9]+.[0-9]+' |
4 | 8 | pull_request:
|
| 9 | +## This workflow needs the `pull-request` permissions to work for the package diffing |
| 10 | +## Refs: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#permissions |
| 11 | +permissions: |
| 12 | + pull-requests: write |
| 13 | + contents: read |
5 | 14 | jobs:
|
6 |
| - supported-versions-matrix: |
7 |
| - name: Supported Versions Matrix |
8 |
| - runs-on: ubuntu-latest |
9 |
| - outputs: |
10 |
| - version: ${{ steps.supported-versions-matrix.outputs.version }} |
11 |
| - steps: |
12 |
| - - uses: actions/checkout@v2 |
13 |
| - - id: supported-versions-matrix |
14 |
| - uses: WyriHaximus/github-action-composer-php-versions-in-range@v1 |
15 |
| - generate-checks-strategy: |
16 |
| - name: Generate Checks |
17 |
| - runs-on: ubuntu-latest |
18 |
| - outputs: |
19 |
| - check: ${{ steps.generate-checks-strategy.outputs.check }} |
20 |
| - steps: |
21 |
| - - uses: actions/checkout@v2 |
22 |
| - - id: generate-checks-strategy |
23 |
| - name: Generate check |
24 |
| - run: | |
25 |
| - printf "Checks found: %s\r\n" $(make task-list-ci) |
26 |
| - printf "::set-output name=check::%s" $(make task-list-ci) |
27 |
| - lint: |
28 |
| - runs-on: ubuntu-latest |
29 |
| - steps: |
30 |
| - - name: Lint Code Base |
31 |
| - uses: docker://github/super-linter:v2.2.0 |
32 |
| - composer-install: |
33 |
| - strategy: |
34 |
| - fail-fast: false |
35 |
| - matrix: |
36 |
| - php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }} |
37 |
| - composer: [lowest, current, highest] |
38 |
| - needs: |
39 |
| - - lint |
40 |
| - - supported-versions-matrix |
41 |
| - runs-on: ubuntu-latest |
42 |
| - container: |
43 |
| - image: wyrihaximusnet/php:${{ matrix.php }}-nts-buster-dev-root |
44 |
| - steps: |
45 |
| - - uses: actions/checkout@v2 |
46 |
| - - name: Cache composer packages |
47 |
| - uses: actions/cache@v1 |
48 |
| - with: |
49 |
| - path: ./vendor/ |
50 |
| - key: ${{ matrix.composer }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }} |
51 |
| - - name: Install Dependencies |
52 |
| - run: composer update --prefer-lowest --no-progress --ansi --no-interaction --prefer-dist -o |
53 |
| - if: matrix.composer == 'lowest' |
54 |
| - - name: Install Dependencies |
55 |
| - run: composer install --ansi --no-progress --no-interaction --prefer-dist -o |
56 |
| - if: matrix.composer == 'current' |
57 |
| - - name: Install Dependencies |
58 |
| - run: composer update --ansi --no-progress --no-interaction --prefer-dist -o |
59 |
| - if: matrix.composer == 'highest' |
60 |
| - qa: |
61 |
| - strategy: |
62 |
| - fail-fast: false |
63 |
| - matrix: |
64 |
| - php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }} |
65 |
| - composer: [lowest, current, highest] |
66 |
| - check: ${{ fromJson(needs.generate-checks-strategy.outputs.check) }} |
67 |
| - needs: |
68 |
| - - composer-install |
69 |
| - - generate-checks-strategy |
70 |
| - - supported-versions-matrix |
71 |
| - runs-on: ubuntu-latest |
72 |
| - container: |
73 |
| - image: wyrihaximusnet/php:${{ matrix.php }}-nts-buster-dev-root |
74 |
| - steps: |
75 |
| - - uses: actions/checkout@v2 |
76 |
| - - name: Cache composer packages |
77 |
| - uses: actions/cache@v2 |
78 |
| - with: |
79 |
| - path: ./vendor/ |
80 |
| - key: ${{ matrix.composer }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }} |
81 |
| - - name: Install Dependencies |
82 |
| - run: (test -f vendor && true ) || composer update --prefer-lowest --no-progress --ansi --no-interaction --prefer-dist -o |
83 |
| - if: matrix.composer == 'lowest' |
84 |
| - - name: Install Dependencies |
85 |
| - run: (test -f vendor && true ) || composer install --ansi --no-progress --no-interaction --prefer-dist -o |
86 |
| - if: matrix.composer == 'current' |
87 |
| - - name: Install Dependencies |
88 |
| - run: (test -f vendor && true ) || composer update --ansi --no-progress --no-interaction --prefer-dist -o |
89 |
| - if: matrix.composer == 'highest' |
90 |
| - - name: Fetch Tags |
91 |
| - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true |
92 |
| - if: matrix.check == 'backward-compatibility-check' |
93 |
| - - run: make ${{ matrix.check }} |
94 |
| - env: |
95 |
| - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} |
96 |
| - COVERALLS_RUN_LOCALLY: ${{ secrets.COVERALLS_RUN_LOCALLY }} |
| 15 | + ci: |
| 16 | + name: Continuous Integration |
| 17 | + uses: WyriHaximus/github-workflows/.github/workflows/package.yaml@main |
0 commit comments