diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 285b205..e3b2222 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,28 +9,42 @@ on: jobs: test: - name: OTP ${{matrix.otp}} + name: OTP ${{matrix.otp}} / rebar3 ${{matrix.rebar3}} / OS ${{matrix.os}} strategy: matrix: - otp: ['24.0', '23.3', '22.3', '21.3'] - runs-on: 'ubuntu-20.04' - env: - OTPVER: ${{ matrix.otp }} + os: ['ubuntu-22.04'] + otp: ['26.1', '25.3', '24.3'] + rebar: ['3.22.1'] + include: + - otp: '26.1' + os: 'windows-2022' + runs-on: ${{matrix.os}} steps: - - uses: actions/checkout@v2 - - uses: ErlGang/setup-erlang@v1.0.0 + - uses: actions/checkout@v3 + - uses: erlef/setup-beam@v1 with: - otp-version: ${{ matrix.otp }} - - run: make rebar3 - - run: make deps - - run: make test - - run: make dialyzer - if: ${{ matrix.otp == '24.0' }} - - run: make codecov - if: ${{ matrix.otp == '24.0' }} - - run: make gcov - if: ${{ matrix.otp == '24.0' }} + otp-version: ${{matrix.otp}} + rebar3-version: ${{matrix.rebar}} + - name: Restore _build + uses: actions/cache@v3 + with: + path: _build + key: _build-cache-for-os-${{runner.os}}-otp-${{steps.setup-beam.outputs.otp-version}}-rebar3-${{steps.setup-beam.outputs.rebar3-version}}-hash-${{hashFiles('rebar.lock')}} + - name: Restore rebar3's cache + uses: actions/cache@v3 + with: + path: ~/.cache/rebar3 + key: rebar3-cache-for-os-${{runner.os}}-otp-${{steps.setup-beam.outputs.otp-version}}-rebar3-${{steps.setup-beam.outputs.rebar3-version}}-hash-${{hashFiles('rebar.lock')}} + - run: rebar3 as test get-deps + - run: rebar3 as test compile + - run: rebar3 as test ct + - run: rebar3 dialyzer + if: ${{ matrix.otp == '26.1' && matrix.os == 'ubuntu-22.04' }} + - run: rebar3 as test codecov analyze + if: ${{ matrix.otp == '26.1' && matrix.os == 'ubuntu-22.04' }} + - run: gcov -o c_src fast_pbkdf2 + if: ${{ matrix.otp == '26.1' && matrix.os == 'ubuntu-22.04' }} - run: pip install --user codecov - if: ${{ matrix.otp == '24.0' }} + if: ${{ matrix.otp == '26.1' && matrix.os == 'ubuntu-22.04' }} - run: /home/runner/.local/bin/codecov - if: ${{ matrix.otp == '24.0' }} + if: ${{ matrix.otp == '26.1' && matrix.os == 'ubuntu-22.04' }} diff --git a/Makefile b/Makefile deleted file mode 100644 index 43482d7..0000000 --- a/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -.PHONY: rel deps test - -REBARVER = 3.15.2 - -all: deps compile - -compile: rebar3 - ./rebar3 compile - -deps: rebar3 - ./rebar3 get-deps - -clean: rebar3 - ./rebar3 clean - -test-deps: rebar3 - ./rebar3 get-deps - -test-compile: rebar3 test-deps - ./rebar3 as test compile - -test: test-compile - ./rebar3 as test ct - -codecov: _build/test/cover/ct.coverdata - ./rebar3 as test codecov analyze - -gcov: test-compile - gcov -o c_src fast_pbkdf2 - -rebar3: - wget https://github.com/erlang/rebar3/releases/download/${REBARVER}/rebar3 &&\ - chmod u+x rebar3 - -dialyzer: rebar3 - ./rebar3 dialyzer diff --git a/rebar.config b/rebar.config index f73d7a5..3203938 100644 --- a/rebar.config +++ b/rebar.config @@ -12,7 +12,7 @@ {proper, "1.4.0"} ]}, {plugins, [ - {rebar3_codecov, "0.3.0"}]}, + {rebar3_codecov, "0.6.0"}]}, {port_env, [ {"CFLAGS", "$CFLAGS -std=c99 -O3 -g -Wall -Wextra -fPIC -I/opt/homebrew/include -I/usr/local/include --coverage"},