diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 63f4bd97..2de8cc96 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,14 +1,24 @@ name: Build on: - push: + push: # Only run on merges into master that modify files under pyscriptjs/ branches: main - pull_request: - branches: '*' + paths: + - pyscriptjs/** + - .github/workflows/** # Test that workflows work when changed + + pull_request: # Run on any PR that modifies files in pyscriptjs/ + paths: + - pyscriptjs/** + - .github/workflows/** jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-latest # Will be self hosted soon + defaults: + run: + working-directory: ./pyscriptjs + steps: - name: Checkout uses: actions/checkout@v3 @@ -30,9 +40,7 @@ jobs: ${{ runner.os }}- - name: Install dependencies run: | - cd pyscriptjs npm install - name: Build pyscript run: | - cd pyscriptjs npm run build diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 5bd1ffc1..a7dbec95 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,14 +1,19 @@ name: Lint on: - push: - branches: main - pull_request: - branches: '*' + + push: # Only run on merges into master that modify files under pyscriptjs/ + branches: + - main + + pull_request: # Run on any PR that modifies files in pyscriptjs/ jobs: build: runs-on: ubuntu-latest + defaults: + run: + working-directory: ./pyscriptjs steps: - name: Checkout uses: actions/checkout@v3 @@ -30,9 +35,7 @@ jobs: ${{ runner.os }}- - name: Install dependencies run: | - cd pyscriptjs npm install - name: Run linter run: | - cd pyscriptjs npm run lint