Merge pull request #3080 from metacpan/update-cpanfile-snapshot #1868
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: test | |
on: | |
push: | |
branches: | |
- 'master' | |
pull_request: | |
branches: | |
- '*' | |
workflow_dispatch: | |
jobs: | |
code-formatting: | |
runs-on: ubuntu-22.04 | |
name: Code Formatting | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Fetch base ref | |
if: ${{ github.event.pull_request }} | |
run: git fetch origin ${{ github.base_ref }}:upstream | |
- run: npm install | |
- name: Install Carton | |
uses: perl-actions/install-with-cpm@v1 | |
with: | |
install: Carton | |
- name: Install CPAN deps | |
uses: perl-actions/install-with-cpm@v1 | |
with: | |
cpanfile: 'cpanfile' | |
args: > | |
--resolver=snapshot | |
--without-runtime | |
--without-test | |
--without-build | |
--with-develop | |
- name: Install precious | |
run: ./bin/install-precious /usr/local/bin | |
- name: Lint modified files | |
if: ${{ github.event.pull_request }} | |
run: precious lint --git-diff-from upstream | |
- name: Lint all files | |
if: ${{ ! github.event.pull_request }} | |
run: precious lint --all | |
docker: | |
runs-on: ubuntu-22.04 | |
name: Docker | |
steps: | |
- name: Build test image | |
id: docker-build-test | |
uses: docker/build-push-action@v5 | |
with: | |
target: test | |
push: false | |
load: true | |
- name: Run Perl tests | |
run: docker run -i ${{ steps.docker-build-test.outputs.imageid }} | |
test: | |
runs-on: ubuntu-20.04 | |
name: Dockerless | |
strategy: | |
fail-fast: false | |
matrix: | |
perl-version: | |
- '5.36' | |
resolver: | |
- snapshot | |
- metacpan | |
container: | |
image: perl:${{ matrix.perl-version }} | |
env: | |
DEVEL_COVER_OPTIONS: '-ignore,^local/' | |
steps: | |
- uses: actions/checkout@v4 | |
if: matrix.resolver == 'snapshot' | |
- uses: actions/checkout@v4 | |
if: matrix.resolver != 'snapshot' | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
- run: npm install | |
- run: apt-get update && apt-get -y install libcmark-dev | |
- name: Install Carton | |
uses: perl-actions/install-with-cpm@v1 | |
with: | |
install: Carton | |
sudo: false | |
- name: Install CPAN deps | |
uses: perl-actions/install-with-cpm@v1 | |
with: | |
cpanfile: 'cpanfile' | |
sudo: false | |
args: > | |
--resolver ${{ matrix.resolver }} | |
- name: Build assets | |
run: npm run build | |
- name: Run tests without coverage | |
if: matrix.resolver != 'snapshot' | |
run: carton exec prove -lr --jobs 2 t | |
env: | |
TEST_TIDYALL_VERBOSE: 1 | |
- name: Install Codecovbash | |
if: matrix.resolver == 'snapshot' | |
uses: perl-actions/install-with-cpm@v1 | |
with: | |
install: | | |
Devel::Cover | |
Devel::Cover::Report::Codecovbash | |
sudo: false | |
- name: Run tests with coverage | |
if: matrix.resolver == 'snapshot' | |
run: carton exec prove -lr --jobs 2 t | |
env: | |
HARNESS_PERL_SWITCHES: -MDevel::Cover=+ignore,^t/ | |
- name: Generate Codecov report | |
if: matrix.resolver == 'snapshot' | |
run: cover -report codecovbash | |
- uses: codecov/codecov-action@v4 | |
if: matrix.resolver == 'snapshot' | |
with: | |
fail_ci_if_error: true | |
file: ./cover_db/codecov.json | |
token: ${{ secrets.CODECOV_TOKEN }} |