| name: Unit test agenda |
| on: |
| # push: |
| # paths: |
| # - '**/unittestagenda.yml' |
| # - 'www/board/agenda/**' |
| # - 'lib/**' |
| |
| workflow_dispatch: |
| |
| permissions: # added using https://github.com/step-security/secure-workflows |
| contents: read |
| |
| jobs: |
| test: |
| strategy: |
| fail-fast: true |
| matrix: |
| os: [ubuntu-20.04, macos-latest] |
| ruby: [2.7] |
| # os: [ubuntu-20.04, ubuntu-22.04] |
| # ruby: [2.7, 3.1] |
| # 2.7 not supported on 22.04 |
| exclude: |
| - os: ubuntu-22.04 |
| ruby: 2.7 |
| runs-on: ${{ matrix.os }} |
| steps: |
| - name: setup Ubuntu missing header files |
| run: | |
| sudo apt-get update |
| sudo apt-get install libldap2-dev |
| sudo apt-get install libsasl2-dev |
| sudo apt-get install libyaml-dev # seems to be needed for installing ruby since psych 5.0.0 release |
| if: matrix.os != 'macos-latest' |
| - uses: actions/setup-node@v3 |
| with: |
| node-version: 'v21.4.0' # works on macOS |
| - uses: actions/checkout@v3 |
| with: |
| persist-credentials: false |
| - uses: ruby/setup-ruby@v1 |
| with: |
| ruby-version: ${{ matrix.ruby }} |
| bundler-cache: true |
| - name: setup agenda 1 |
| run: | |
| cd www/board/agenda |
| bundle install |
| - name: setup agenda 2 |
| # need to run the ruby that has all the gems installed |
| run: | |
| sudo mkdir -p /srv |
| sudo bash -c 'printf "\n\n\n" >/srv/ldap.txt' |
| ls -l /srv |
| echo ":ldap: ldaps://ldap-us.apache.org:636" >> .whimsy |
| sudo $(which ruby) -I $PWD/lib -r whimsy/asf -e "ASF::LDAP.configure" |
| - name: show environ |
| run: | |
| node -v |
| npm -v |
| gem list |
| - name: test agenda code |
| run: | |
| cd www/board/agenda |
| # SKIP_NAVIGATION=1 bundle exec rake RSPEC_OPTS='--pattern=secret*.rb' || echo "action_state=failed" >> $GITHUB_ENV |
| SKIP_NAVIGATION=1 bundle exec rake || echo "action_state=failed" >> $GITHUB_ENV |
| continue-on-error: true |
| - name: Run Summary |
| run: | |
| npm list # added by Rakefile |
| echo "${{ env.action_state }}" |
| # This will be be true for a successful run |
| test "${{ env.action_state }}" != 'failed' |