Bump the npm_and_yarn group across 1 directory with 3 updates #403
Workflow file for this run
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: PR | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
steps: | |
- name: Check out | |
uses: actions/checkout@v2 | |
- name: Check for style & bugs | |
uses: ludeeus/[email protected] | |
with: | |
ignore: wait-for | |
env: | |
SHELLCHECK_OPTS: -s bash -e SC2162 -e SC2153 | |
- name: Set up Node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 17 | |
- name: Check .env drift | |
run: | | |
result=$(cmp --silent .env kube/base/faros/config/.env; echo $?) | |
if [[ $result -ne 0 ]]; then | |
echo "####" | |
echo "# Drift detected on configuration" | |
echo "# Ensure that 'kube/base/faros/config/.env' is identical to '.env'" | |
echo "# Execute 'cp -f .env kube/base/faros/config/.env' to sync the files" | |
echo "####" | |
exit $result | |
else | |
echo "No drift detected" | |
fi | |
- name: Build (init) | |
run: npm ci --unsafe-perm | |
working-directory: init | |
- name: Build (cli) | |
run: npm ci --unsafe-perm | |
working-directory: cli | |
- name: Run unit tests | |
run: npm run test:unit -- --coverage | |
working-directory: init | |
# In order to optimize for speed, we use the latest init image. | |
- name: Start services | |
run: [email protected] FAROS_INIT_IMAGE=farosai/faros-ce-init:latest docker compose up --quiet-pull -d | |
- name: Show logs | |
run: docker compose logs --tail all | |
- name: Show services | |
run: docker compose ps -a | |
# The init container is configured to restart 3 times on failure, but | |
# docker wait only uses the first exit code. This container's entrypoint | |
# always fails on its first attempt, but usually one retry is sufficient. | |
- name: Wait for init to complete | |
uses: nick-fields/retry@v3 | |
with: | |
max_attempts: 2 | |
timeout_minutes: 5 | |
command: | | |
CONTAINER_EXIT_CODE=$(docker wait faros-community-edition-faros-init-1) | |
echo "Faros init container exit code was ${CONTAINER_EXIT_CODE}" | |
[[ $CONTAINER_EXIT_CODE -eq 0 ]] | |
- name: Get Hasura Admin Secret | |
run: | | |
echo $(cat .env | grep "^HASURA_GRAPHQL_ADMIN_SECRET") >> "$GITHUB_ENV" | |
- name: Run integration tests (init) | |
run: npm run test:integration -- --coverage | |
working-directory: init | |
- name: Run integration tests (cli) | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: npm run test:integration -- --coverage | |
working-directory: cli | |
- name: Stop services | |
run: docker compose down |