From 120efebd21c9899a12651bd04e24d37f1d6f2571 Mon Sep 17 00:00:00 2001 From: Charles McGarvey Date: Sat, 30 Apr 2022 19:29:29 -0600 Subject: [PATCH] Add GitHub actions for testing --- .github/workflows/linux.yml | 38 +++++++++++++++++++++++++++++++++++ .github/workflows/macos.yml | 31 ++++++++++++++++++++++++++++ .github/workflows/windows.yml | 33 ++++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+) create mode 100644 .github/workflows/linux.yml create mode 100644 .github/workflows/macos.yml create mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 0000000..4346d72 --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,38 @@ +name: Linux + +on: + push: + branches: ["*"] + pull_request: + branches: ["*"] + +jobs: + unit-tests: + name: "Test perl v${{ matrix.perl }} on Linux" + + runs-on: ubuntu-latest + container: + image: perldocker/perl-tester:${{ matrix.perl }} + + strategy: + fail-fast: false + matrix: + perl: + - "5.34" + - "5.32" + - "5.30" + - "5.28" + - "5.26" + - "5.24" + - "5.22" + - "5.20" + + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Install author dependencies + run: dzil authordeps --missing |cpanm -n + - name: Install module dependencies + run: dzil listdeps --develop --missing |cpanm -n + - name: Run tests + run: dzil smoke --author --release diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 0000000..09ab99e --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,31 @@ +name: macOS + +on: + push: + branches: ["*"] + pull_request: + branches: ["*"] + +jobs: + unit-tests: + name: "Test perl on macOS" + + runs-on: macos-latest + + steps: + - name: Install perl + run: | + brew install perl cpanminus + perl -MConfig -e'print $Config{installscript}' >>$GITHUB_PATH + - name: Print perl version + run: perl -V + - name: Install dzil + run: cpanm -n Dist::Zilla + - name: Checkout code + uses: actions/checkout@v3 + - name: Install author dependencies + run: dzil authordeps --missing |cpanm -n + - name: Install module dependencies + run: dzil listdeps --develop --missing |cpanm -n + - name: Run tests + run: dzil smoke --author --release diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000..cffbcdb --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,33 @@ +name: Windows + +on: + push: + branches: ["*"] + pull_request: + branches: ["*"] + +jobs: + unit-tests: + name: "Test perl on Windows" + + runs-on: windows-latest + + steps: + - name: Install perl + run: | + choco install strawberryperl + echo "C:\strawberry\c\bin;C:\strawberry\perl\site\bin;C:\strawberry\perl\bin" >>$GITHUB_PATH + - name: Print perl version + run: perl -V + - name: Install dzil + run: cpanm -n Dist::Zilla + - name: Configure git + run: git config --global core.autocrlf input + - name: Checkout code + uses: actions/checkout@v3 + - name: Install author dependencies + run: dzil authordeps --missing |cpanm -n + - name: Install module dependencies + run: dzil listdeps --develop --missing |cpanm -n + - name: Run tests + run: dzil smoke --author --release -- 2.43.0