diff --git a/.github/workflows/rake.yml b/.github/workflows/rake.yml new file mode 100644 index 0000000..7709b7c --- /dev/null +++ b/.github/workflows/rake.yml @@ -0,0 +1,90 @@ +name: rake + +on: + push: + branches: [ master, main ] + tags: [ v* ] + pull_request: + +env: + RNP_VERSION: master + DATABASE_URL: "mysql2://root@127.0.0.1/keyserver_test" + DEPS_BUILD_DIR: ${{ github.workspace }}/build + DEPS_PREFIX: ${{ github.workspace }}/opt + BOTAN_PREFIX: ${{ env.DEPS_PREFIX }}/botan + JSONC_PREFIX: ${{ env.DEPS_PREFIX }}/json-c + RNP_PREFIX: ${{ env.DEPS_PREFIX }}/rnp + +jobs: + rake: + name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }} + runs-on: ${{ matrix.os }} + continue-on-error: ${{ matrix.experimental }} + strategy: + fail-fast: false + matrix: + ruby: [ '3.0', '2.7', '2.6', '2.5' ] + rnp: [ master ] + os: [ ubuntu-latest ] + experimental: [ false ] + include: + - ruby: '2.5' + rnp: v0.10.0 + os: ubuntu-latest + - ruby: '2.5' + rnp: v0.11.0 + os: ubuntu-latest + - ruby: '2.5' + rnp: v0.12.0 + os: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: true + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + + - uses: shogo82148/actions-setup-mysql@v1 + with: + mysql-version: '8.0' + + - run: mysql -e 'CREATE DATABASE keyserver_test;' + + - run: | + mkdir -p ${DEPS_PREFIX} + + - working-directory: ci + run: | + ./install_botan.sh + ./install_json_c.sh + ./install_rnp.sh + # Be aware of differences between LD_LIBRARY_PATH and LD_RUN_PATH. + # - http://osr507doc.sco.com/en/tools/ccs_linkedit_dynamic_dirsearch.html + # - https://www.hpc.dtu.dk/?page_id=1180 + # + # You should be careful when attempting to replicate following in your + # setup, because setting LD_LIBRARY_PATH is often a bad idea. Nevertheless, + # it is okay here in Travis, and actually any attempt to change these led me + # to linking failures. Side note: I am not a Linux expert, and you may be + # more lucky. + # + # I'd be happy to get rid of LD_LIBRARY_PATH eventually in some future + # pull request. + echo "LD_LIBRARY_PATH=${BOTAN_PREFIX}/lib:${JSONC_PREFIX}/lib:${RNP_PREFIX}/lib" >> $GITHUB_ENV + echo "PATH=${RNP_PREFIX}/bin:${PATH}" >> $GITHUB_ENV + + - run: bundle exec rake + + tests-passed: + needs: rake + runs-on: ubuntu-latest + steps: + - uses: peter-evans/repository-dispatch@v1 + with: + token: ${{ secrets.METANORMA_CI_PAT_TOKEN || secrets.GITHUB_TOKEN }} + repository: ${{ github.repository }} + event-type: tests-passed + client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}'