ci: use working-directory instead of cd command

This commit is contained in:
link2xt
2023-06-02 17:00:27 +00:00
parent 3b6d21301b
commit 55bc556bcf
5 changed files with 23 additions and 33 deletions

View File

@@ -38,13 +38,12 @@ jobs:
node --version node --version
echo $DELTACHAT_JSONRPC_TAR_GZ echo $DELTACHAT_JSONRPC_TAR_GZ
- name: Install dependencies without running scripts - name: Install dependencies without running scripts
run: | working-directory: deltachat-jsonrpc/typescript
cd deltachat-jsonrpc/typescript run: npm install --ignore-scripts
npm install --ignore-scripts
- name: Package - name: Package
shell: bash shell: bash
working-directory: deltachat-jsonrpc/typescript
run: | run: |
cd deltachat-jsonrpc/typescript
npm run build npm run build
npm pack . npm pack .
ls -lah ls -lah

View File

@@ -22,24 +22,19 @@ jobs:
- name: Add Rust cache - name: Add Rust cache
uses: Swatinem/rust-cache@v2 uses: Swatinem/rust-cache@v2
- name: npm install - name: npm install
run: | working-directory: deltachat-jsonrpc/typescript
cd deltachat-jsonrpc/typescript run: npm install
npm install
- name: Build TypeScript, run Rust tests, generate bindings - name: Build TypeScript, run Rust tests, generate bindings
run: | working-directory: deltachat-jsonrpc/typescript
cd deltachat-jsonrpc/typescript run: npm run build
npm run build
- name: Run integration tests - name: Run integration tests
run: | working-directory: deltachat-jsonrpc/typescript
cd deltachat-jsonrpc/typescript run: npm run test
npm run test
env: env:
DCC_NEW_TMP_EMAIL: ${{ secrets.DCC_NEW_TMP_EMAIL }} DCC_NEW_TMP_EMAIL: ${{ secrets.DCC_NEW_TMP_EMAIL }}
- name: make sure websocket server version still builds - name: make sure websocket server version still builds
run: | working-directory: deltachat-jsonrpc
cd deltachat-jsonrpc run: cargo build --bin deltachat-jsonrpc-server --features webserver
cargo build --bin deltachat-jsonrpc-server --features webserver
- name: Run linter - name: Run linter
run: | working-directory: deltachat-jsonrpc/typescript
cd deltachat-jsonrpc/typescript run: npm run prettier:check
npm run prettier:check

View File

@@ -17,8 +17,8 @@ jobs:
node-version: 16.x node-version: 16.x
- name: npm install and generate documentation - name: npm install and generate documentation
working-directory: node
run: | run: |
cd node
npm i --ignore-scripts npm i --ignore-scripts
npx typedoc npx typedoc
mv docs js mv docs js

View File

@@ -46,13 +46,12 @@ jobs:
- name: Install dependencies & build - name: Install dependencies & build
if: steps.cache.outputs.cache-hit != 'true' if: steps.cache.outputs.cache-hit != 'true'
run: | working-directory: node
cd node run: npm install --verbose
npm install --verbose
- name: Build Prebuild - name: Build Prebuild
working-directory: node
run: | run: |
cd node
npm run prebuildify npm run prebuildify
tar -zcvf "${{ matrix.os }}.tar.gz" -C prebuilds . tar -zcvf "${{ matrix.os }}.tar.gz" -C prebuilds .

View File

@@ -52,25 +52,22 @@ jobs:
- name: Install dependencies & build - name: Install dependencies & build
if: steps.cache.outputs.cache-hit != 'true' if: steps.cache.outputs.cache-hit != 'true'
run: | working-directory: node
cd node run: npm install --verbose
npm install --verbose
- name: Test - name: Test
timeout-minutes: 10 timeout-minutes: 10
if: runner.os != 'Windows' if: runner.os != 'Windows'
run: | working-directory: node
cd node run: npm run test
npm run test
env: env:
DCC_NEW_TMP_EMAIL: ${{ secrets.DCC_NEW_TMP_EMAIL }} DCC_NEW_TMP_EMAIL: ${{ secrets.DCC_NEW_TMP_EMAIL }}
NODE_OPTIONS: "--force-node-api-uncaught-exceptions-policy=true" NODE_OPTIONS: "--force-node-api-uncaught-exceptions-policy=true"
- name: Run tests on Windows, except lint - name: Run tests on Windows, except lint
timeout-minutes: 10 timeout-minutes: 10
if: runner.os == 'Windows' if: runner.os == 'Windows'
run: | working-directory: node
cd node run: npm run test:mocha
npm run test:mocha
env: env:
DCC_NEW_TMP_EMAIL: ${{ secrets.DCC_NEW_TMP_EMAIL }} DCC_NEW_TMP_EMAIL: ${{ secrets.DCC_NEW_TMP_EMAIL }}
NODE_OPTIONS: "--force-node-api-uncaught-exceptions-policy=true" NODE_OPTIONS: "--force-node-api-uncaught-exceptions-policy=true"