|
| 1 | +--- |
| 2 | +name: dzil build and test |
| 3 | + |
| 4 | +on: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - "*" |
| 8 | + pull_request: |
| 9 | + branches: |
| 10 | + - "*" |
| 11 | + schedule: |
| 12 | + - cron: "15 4 * * 0" # Every Sunday morning |
| 13 | + |
| 14 | +jobs: |
| 15 | + build-job: |
| 16 | + name: Build distribution |
| 17 | + runs-on: ubuntu-latest |
| 18 | + container: |
| 19 | + image: perldocker/perl-tester:5.32 |
| 20 | + steps: |
| 21 | + - uses: actions/checkout@v2 |
| 22 | + - name: Run Tests |
| 23 | + env: |
| 24 | + AUTHOR_TESTING: 1 |
| 25 | + AUTOMATED_TESTING: 1 |
| 26 | + EXTENDED_TESTING: 1 |
| 27 | + RELEASE_TESTING: 1 |
| 28 | + run: auto-build-and-test-dist |
| 29 | + - uses: actions/upload-artifact@v2 |
| 30 | + with: |
| 31 | + name: build_dir |
| 32 | + path: build_dir |
| 33 | + if: ${{ github.actor != 'nektos/act' }} |
| 34 | + coverage-job: |
| 35 | + needs: build-job |
| 36 | + runs-on: ubuntu-latest |
| 37 | + container: |
| 38 | + image: perldocker/perl-tester:5.32 |
| 39 | + steps: |
| 40 | + - uses: actions/checkout@v2 # codecov wants to be inside a Git repository |
| 41 | + - uses: actions/download-artifact@v2 |
| 42 | + with: |
| 43 | + name: build_dir |
| 44 | + path: . |
| 45 | + - name: Install deps and test |
| 46 | + run: cpan-install-dist-deps && test-dist |
| 47 | + env: |
| 48 | + AUTHOR_TESTING: 1 |
| 49 | + AUTOMATED_TESTING: 1 |
| 50 | + EXTENDED_TESTING: 1 |
| 51 | + CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}} |
| 52 | + httpbin-job: |
| 53 | + needs: build-job |
| 54 | + runs-on: ubuntu-latest |
| 55 | + steps: |
| 56 | + - uses: actions/download-artifact@v2 |
| 57 | + with: |
| 58 | + name: build_dir |
| 59 | + path: . |
| 60 | + - name: Pull httpbin Docker image |
| 61 | + run: docker pull kennethreitz/httpbin |
| 62 | + - name: Run httpbin |
| 63 | + run: docker run -d -p 31234:80 kennethreitz/httpbin |
| 64 | + - name: docker pull perldocker/perl-tester:5.32 |
| 65 | + run: docker pull perldocker/perl-tester:5.32 |
| 66 | + - name: Run tests via Docker |
| 67 | + run: > |
| 68 | + docker run |
| 69 | + --network="host" |
| 70 | + --env AUTHOR_TESTING=1 |
| 71 | + -v |
| 72 | + $(pwd):/home/dist perldocker/perl-tester:5.32 |
| 73 | + /bin/sh -c "cd /home/dist && cpan-install-dist-deps && prove -lv xt/rt-112313.t" |
| 74 | + test-job: |
| 75 | + needs: build-job |
| 76 | + runs-on: ${{ matrix.os }} |
| 77 | + strategy: |
| 78 | + fail-fast: false |
| 79 | + matrix: |
| 80 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 81 | + perl-version: |
| 82 | + - "5.8" |
| 83 | + - "5.10" |
| 84 | + - "5.12" |
| 85 | + - "5.14" |
| 86 | + - "5.16" |
| 87 | + - "5.18" |
| 88 | + - "5.20" |
| 89 | + - "5.22" |
| 90 | + - "5.24" |
| 91 | + - "5.26" |
| 92 | + - "5.28" |
| 93 | + - "5.30" |
| 94 | + - "5.32" |
| 95 | + exclude: |
| 96 | + - os: windows-latest |
| 97 | + perl-version: "5.8" |
| 98 | + - os: windows-latest |
| 99 | + perl-version: "5.10" |
| 100 | + - os: windows-latest |
| 101 | + perl-version: "5.12" |
| 102 | + - os: windows-latest |
| 103 | + perl-version: "5.14" |
| 104 | + - os: windows-latest |
| 105 | + perl-version: "5.16" |
| 106 | + - os: windows-latest |
| 107 | + perl-version: "5.32" |
| 108 | + name: Perl ${{ matrix.perl-version }} on ${{ matrix.os }} |
| 109 | + steps: |
| 110 | + - name: Set Up Perl |
| 111 | + uses: shogo82148/actions-setup-perl@v1 |
| 112 | + with: |
| 113 | + perl-version: ${{ matrix.perl-version }} |
| 114 | + distribution: strawberry # this option only used on Windows |
| 115 | + - uses: actions/download-artifact@v2 |
| 116 | + with: |
| 117 | + name: build_dir |
| 118 | + path: . |
| 119 | + - name: install deps using cpm |
| 120 | + uses: perl-actions/install-with-cpm@v1 |
| 121 | + with: |
| 122 | + cpanfile: "cpanfile" |
| 123 | + args: "--with-suggests --with-recommends --with-test" |
| 124 | + - run: prove -l t xt |
| 125 | + env: |
| 126 | + AUTHOR_TESTING: 1 |
| 127 | + RELEASE_TESTING: 1 |
0 commit comments