simplify & focus #2
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: Package Tests | |
on: [push, pull_request] | |
jobs: | |
npm: | |
name: "@wq/${{ matrix.package }}" | |
runs-on: ubuntu-20.04 | |
env: | |
PACKAGE: ${{ matrix.package }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.10"] | |
node-version: [18] | |
package: | |
- react | |
- material | |
- material-web | |
- material-native | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up Node ${{ matrix.node-version }} | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: npm ci && npm run build | |
- name: Install native dependencies | |
if: matrix.package == 'material-native' || matrix.package == 'map-gl-native' | |
run: cd packages/$PACKAGE && npm ci | |
- name: Lint with ESLint | |
run: npm run lint | |
- name: Start test server | |
run: python -m tests.server & | |
- name: Test with Jest | |
run: | | |
cd packages/$PACKAGE | |
npm run test | |
- uses: smartsquaregmbh/[email protected] | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
with: | |
keep: 5 | |
names: ${{ matrix.package }} | |
- name: Publish to Github Packages | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
run: | | |
python -m pip install setuptools_scm | |
./set_dev_version.sh | |
echo "registry=https://npm.pkg.github.com/wq" > .npmrc | |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc | |
cp .npmrc packages/$PACKAGE/.npmrc # for native builds | |
cd packages/$PACKAGE | |
npm publish |