REFACTORING: Page
should be called Lectern
.
#281
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Acceptance tests | |
on: | |
- push | |
- pull_request | |
jobs: | |
build: | |
uses: ./.github/workflows/build.yml | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download sources | |
uses: actions/checkout@v3 | |
- name: Download tools | |
run: | | |
cd backend | |
docker compose pull | |
docker pull benel/cucumber-capybara | |
- name: Install and launch backend with test data | |
run: | | |
cd backend | |
export COUCHDB_USER="TO_BE_CHANGED" | |
export COUCHDB_PASSWORD="TO_BE_CHANGED" | |
docker compose up -d | |
- name: Wait for backend | |
uses: docker://benel/wait-for-response:1 | |
with: | |
args: http://localhost:5984/hyperglosae 401 5000 500 | |
- name: Enable CORS and public access in backend | |
run: | | |
export COUCHDB_USER="TO_BE_CHANGED" | |
export COUCHDB_PASSWORD="TO_BE_CHANGED" | |
curl -X PUT -u "${COUCHDB_USER}:${COUCHDB_PASSWORD}" -s localhost:5984/_node/nonode@nohost/_config/httpd/enable_cors --data '"true"' | |
curl -X PUT -u "${COUCHDB_USER}:${COUCHDB_PASSWORD}" -s localhost:5984/_node/nonode@nohost/_config/cors/origins --data '"*"' | |
curl -X PUT -u "${COUCHDB_USER}:${COUCHDB_PASSWORD}" -s localhost:5984/hyperglosae/_security --data '{"members":{"roles":[]},"admins":{"roles":["_admin"]}}' | |
curl -X PUT -u "${COUCHDB_USER}:${COUCHDB_PASSWORD}" -s localhost:5984/_users | |
curl -X PUT -u "${COUCHDB_USER}:${COUCHDB_PASSWORD}" -s localhost:5984/_users/org.couchdb.user:alice --data '{"name":"alice", "password":"whiterabbit", "roles":[], "type":"user"}' | |
curl -X PUT -u "${COUCHDB_USER}:${COUCHDB_PASSWORD}" -s localhost:5984/_users/org.couchdb.user:bill --data '{"name":"bill", "password":"madhatter", "roles":[], "type":"user"}' | |
- name: Wait for frontend build | |
uses: lewagon/wait-on-check-action@v1.3.1 | |
with: | |
check-name: build / build | |
ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Get frontend build | |
uses: actions/download-artifact@v3 | |
with: | |
name: frontend-build | |
path: frontend/build | |
- name: Start frontend | |
run: | | |
cd frontend | |
npm run preprod & | |
- name: Wait for frontend | |
uses: docker://benel/wait-for-response:1 | |
with: | |
args: http://localhost:3000/ 200 30000 500 | |
- name: Run tests | |
run: | |
docker run --rm -v "$(pwd)":/app --tty --net="host" --env APP_HOST="http://`hostname`:3000" benel/cucumber-capybara --retry 2 --fail-fast --no-source --no-snippets | |
shell: 'script -q -e -c "bash {0}"' |