|
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 | | - generate-checks-strategy: |
7 | | - name: Generate Checks |
8 | | - runs-on: ubuntu-latest |
9 | | - outputs: |
10 | | - check: ${{ steps.generate-checks-strategy.outputs.check }} |
11 | | - steps: |
12 | | - - uses: actions/checkout@v1 |
13 | | - - id: generate-checks-strategy |
14 | | - name: Generate check |
15 | | - run: | |
16 | | - printf "Checks found: %s\r\n" $(make task-list-ci) |
17 | | - printf "::set-output name=check::%s" $(make task-list-ci) |
18 | | - lint: |
19 | | - runs-on: ubuntu-latest |
20 | | - steps: |
21 | | - - name: Lint Code Base |
22 | | - uses: docker://github/super-linter:v2.2.0 |
23 | | - composer-install: |
24 | | - strategy: |
25 | | - fail-fast: false |
26 | | - matrix: |
27 | | - php: [7.4] |
28 | | - composer: [lowest, current, highest] |
29 | | - needs: lint |
30 | | - runs-on: ubuntu-latest |
31 | | - container: |
32 | | - image: ghcr.io/wyrihaximusnet/php:${{ matrix.php }}-zts-alpine3.12-dev-root |
33 | | - steps: |
34 | | - - uses: actions/checkout@v1 |
35 | | - - name: Cache composer packages |
36 | | - uses: actions/cache@v1 |
37 | | - with: |
38 | | - path: ./vendor/ |
39 | | - key: ${{ matrix.composer }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }} |
40 | | - - name: Install Dependencies |
41 | | - run: composer update --prefer-lowest --no-progress --ansi --no-interaction --prefer-dist -o |
42 | | - if: matrix.composer == 'lowest' |
43 | | - - name: Install Dependencies |
44 | | - run: composer install --ansi --no-progress --no-interaction --prefer-dist -o |
45 | | - if: matrix.composer == 'current' |
46 | | - - name: Install Dependencies |
47 | | - run: composer update --ansi --no-progress --no-interaction --prefer-dist -o |
48 | | - if: matrix.composer == 'highest' |
49 | | - qa: |
50 | | - strategy: |
51 | | - fail-fast: false |
52 | | - matrix: |
53 | | - php: [7.4] |
54 | | - composer: [lowest, current, highest] |
55 | | - check: ${{ fromJson(needs.generate-checks-strategy.outputs.check) }} |
56 | | - needs: |
57 | | - - composer-install |
58 | | - - generate-checks-strategy |
59 | | - runs-on: ubuntu-latest |
60 | | - container: |
61 | | - image: ghcr.io/wyrihaximusnet/php:${{ matrix.php }}-zts-alpine3.12-dev-root |
62 | | - steps: |
63 | | - - uses: actions/checkout@v1 |
64 | | - - name: Cache composer packages |
65 | | - uses: actions/cache@v1 |
66 | | - with: |
67 | | - path: ./vendor/ |
68 | | - key: ${{ matrix.composer }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }} |
69 | | - - name: Install Dependencies |
70 | | - run: (test -f vendor && true ) || composer update --prefer-lowest --no-progress --ansi --no-interaction --prefer-dist -o |
71 | | - if: matrix.composer == 'lowest' |
72 | | - - name: Install Dependencies |
73 | | - run: (test -f vendor && true ) || composer install --ansi --no-progress --no-interaction --prefer-dist -o |
74 | | - if: matrix.composer == 'current' |
75 | | - - name: Install Dependencies |
76 | | - run: (test -f vendor && true ) || composer update --ansi --no-progress --no-interaction --prefer-dist -o |
77 | | - if: matrix.composer == 'highest' |
78 | | - - name: Fetch Tags |
79 | | - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* || true |
80 | | - if: matrix.check == 'backward-compatibility-check' |
81 | | - - run: make ${{ matrix.check }} |
82 | | - env: |
83 | | - COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} |
84 | | - 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