Skip to content

Add caching.

Add caching. #1437

name: Continuous Integration
on:
push:
pull_request:
release:
types: [created]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [
ubuntu-22.04,
ubuntu-20.04,
macos-11,
# macos-10.15,
# windows-2022,
# windows-2019,
# windows-2016
]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '20.5'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run-script buildExpoDoctor
- run: npm run-script buildLint
- run: npm run-script buildTypeScript
- run: npm run-script buildJest
- uses: shivammathur/setup-php@v2
with:
php-version: 8.0
coverage: xdebug
- run: composer install
- run: vendor/bin/psalm
- run: mkdir -p test_results
- run: vendor/bin/phpunit --coverage-text | tee test_results/unit
- run: grep -E "^\s*Lines:\s*100\.00%\s*\([0-9]+\/[0-9]+\)\s*$" test_results/unit
shell: bash
release:
if: github.event_name == 'release' && github.event.action == 'created'
needs: test
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run-script buildTypeScript
- run: echo ${{ secrets.NPMRC }} > ${NPM_CONFIG_USERCONFIG}
- run: "sed -i \"s/\\\"version\\\": \\\"0.0.0\\\",/\\\"version\\\": \\\"${GITHUB_REF/refs\\/tags\\/v/}\\\",/g\" package.json"
- run: npm publish