Repository: jeremyjh/dialyxir
Pull request #427 (2021-03-21 12:49:02)

Use Github Actions instead of TravisCI
Hello.

I've realized that there are no tests running at commit/PR into your repo.
It seems that you've previously used TravisCI for that. I'm not sure why is it disabled now, but I personally faced the issue with their new billing plans and too strict limitations for running builds for open source projects. Maybe this is your case too.

Here I've replaced TravisCI integration with Github Actions. All steps remain the same. You can check results here:
https://github.com/dolfinus/dialyxir/runs/2159686660

What do you think about this PR?


Patch:
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 49af772..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-language: elixir
-elixir:
-  - 1.9.4
-  - 1.10.4
-  - 1.11.1
-otp_release:
-  - 21.3
-  - 22.3
-script:
-  - mix test --trace
-  - MIX_ENV=prod mix do compile --warnings-as-errors, archive.build, archive.install --force
-  - mix format --check-formatted
-  - MIX_ENV=prod mix dialyzer --list-unused-filters
-  - OUTPUT_TESTS=true mix test
-  - MIX_ENV=prod mix dialyzer --format short
-  - MIX_ENV=prod mix dialyzer --format raw
-  - MIX_ENV=prod mix dialyzer --format dialyzer
-  - MIX_ENV=examples mix dialyzer --format short --ignore-exit-status
-branches:
-  except:
-    - /^[0-9]\.[0-9]/


Test patch:
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 0000000..447bb16
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,114 @@
+name: CI
+
+on:
+  push:
+  pull_request:
+    branches:
+      - master
+
+jobs:
+  check_duplicate_runs:
+    name: Check for duplicate runs
+    continue-on-error: true
+    runs-on: ubuntu-latest
+    outputs:
+      should_skip: ${{ steps.skip_check.outputs.should_skip }}
+    steps:
+      - id: skip_check
+        uses: fkirc/skip-duplicate-actions@master
+        with:
+          concurrent_skipping: always
+          cancel_others: true
+          skip_after_successful_duplicate: true
+          paths_ignore: '["**/README.md", "**/CHANGELOG.md", "**/LICENSE"]'
+          do_not_skip: '["pull_request"]'
+
+  test:
+    name: Elixir ${{matrix.elixir}} / OTP ${{matrix.otp}}
+    runs-on: ubuntu-latest
+    needs: check_duplicate_runs
+    if: ${{ needs.check_duplicate_runs.outputs.should_skip != 'true' }}
+
+    strategy:
+      matrix:
+        elixir:
+        - '1.9.4'
+        - '1.10.4'
+        - '1.11.1'
+        otp:
+        - '21.3'
+        - '22.3'
+        - '23.0'
+
+    steps:
+    - name: Checkout
+      uses: actions/checkout@v2
+
+    - name: Set up Elixir
+      uses: erlef/setup-elixir@v1
+      with:
+        elixir-version: ${{ matrix.elixir }}
+        otp-version: ${{ matrix.otp }}
+
+    - name: Restore deps cache
+      uses: actions/cache@v2
+      with:
+        path: |
+          deps
+          _build
+        key: ${{ runner.os }}-deps-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}-git-${{ github.sha }}
+        restore-keys: |
+          ${{ runner.os }}-deps-${{ matrix.otp }}-${{ matrix.elixir }}-${{ hashFiles('**/mix.lock') }}
+          ${{ runner.os }}-deps-${{ matrix.otp }}-${{ matrix.elixir }}
+
+    - name: Install package dependencies
+      run: mix deps.get
+
+    - name: Remove compiled application files
+      run: mix clean
+
+    - name: Compile dependencies
+      run: mix compile
+      env:
+        MIX_ENV: test
+
+    - name: Run unit tests
+      run: mix test --trace
+
+    - name: Check compilation warnings
+      run: mix do compile --warnings-as-errors, archive.build, archive.install --force
+      env:
+        MIX_ENV: prod
+
+    - name: Check source code formatting
+      run: mix format --check-formatted
+
+    - name: Check source code formatting
+      run: mix dialyzer --list-unused-filters
+      env:
+        MIX_ENV: prod
+
+    - name: Run output tests
+      run: mix test
+      env:
+        OUTPUT_TESTS: true
+
+    - name: Get results in short format
+      run: mix dialyzer --format short
+      env:
+        MIX_ENV: prod
+
+    - name: Get results in raw format
+      run: mix dialyzer --format raw
+      env:
+        MIX_ENV: prod
+
+    - name: Get results in dialyzer format
+      run: mix dialyzer --format dialyzer
+      env:
+        MIX_ENV: prod
+
+    - name: Check examples
+      run: mix dialyzer --format short --ignore-exit-status
+      env:
+        MIX_ENV: examples