From fa24b0e3ce8a2fc301b978b520840eb5bfdd20f0 Mon Sep 17 00:00:00 2001 From: sam Date: Fri, 18 Aug 2023 21:49:34 +0200 Subject: [PATCH] ci: Run Workflows on Pull Request (#21) --- .github/workflows/build_action.yaml | 3 +++ .github/workflows/directory.yml | 11 ++++++++++- .github/workflows/file.yml | 8 +++++++- .github/workflows/package-action.yaml | 3 +++ .github/workflows/platforms.yml | 19 +++++++++---------- 5 files changed, 32 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build_action.yaml b/.github/workflows/build_action.yaml index fe175c8..01a2155 100644 --- a/.github/workflows/build_action.yaml +++ b/.github/workflows/build_action.yaml @@ -7,6 +7,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: actions/setup-node@v3 + with: + node-version: 16 - run: npm install - name: Build action (if not already built) if: "!startsWith(github.ref, 'refs/heads/release')" diff --git a/.github/workflows/directory.yml b/.github/workflows/directory.yml index 377067d..37048dd 100644 --- a/.github/workflows/directory.yml +++ b/.github/workflows/directory.yml @@ -1,6 +1,6 @@ name: Test Directory Extraction -on: [push] +on: [pull_request] jobs: action: @@ -12,6 +12,9 @@ jobs: name: Extract Contents of Directory from Example Image steps: - uses: actions/checkout@v2 + - uses: actions/setup-node@v3 + with: + node-version: 16 - name: Load action build from cache uses: actions/cache@v3 with: @@ -36,6 +39,9 @@ jobs: name: Extract Nested Directory from Example Image steps: - uses: actions/checkout@v2 + - uses: actions/setup-node@v3 + with: + node-version: 16 - name: Load action build from cache uses: actions/cache@v3 with: @@ -56,6 +62,9 @@ jobs: name: Extract Nested Contents of Directory from Example Image steps: - uses: actions/checkout@v2 + - uses: actions/setup-node@v3 + with: + node-version: 16 - name: Load action build from cache uses: actions/cache@v3 with: diff --git a/.github/workflows/file.yml b/.github/workflows/file.yml index 8de3206..5161640 100644 --- a/.github/workflows/file.yml +++ b/.github/workflows/file.yml @@ -1,6 +1,6 @@ name: Test File Extraction -on: [push] +on: [pull_request] jobs: action: @@ -12,6 +12,9 @@ jobs: name: Extract Example File From Root of Built Image steps: - uses: actions/checkout@v2 + - uses: actions/setup-node@v3 + with: + node-version: 16 - name: Load action build from cache uses: actions/cache@v3 with: @@ -31,6 +34,9 @@ jobs: name: Extract Nexted Example File From Built Image steps: - uses: actions/checkout@v2 + - uses: actions/setup-node@v3 + with: + node-version: 16 - name: Load action build from cache uses: actions/cache@v3 with: diff --git a/.github/workflows/package-action.yaml b/.github/workflows/package-action.yaml index c45f7b7..f864d0c 100644 --- a/.github/workflows/package-action.yaml +++ b/.github/workflows/package-action.yaml @@ -18,6 +18,9 @@ jobs: ref: "${{ env.release }}" fetch-depth: 0 ssh-key: "${{ secrets.COMMIT_KEY }}" + - uses: actions/setup-node@v3 + with: + node-version: 16 - uses: pr-mpt/actions-merge-branch@v2 with: from: "origin/${{ env.source }}" diff --git a/.github/workflows/platforms.yml b/.github/workflows/platforms.yml index 5d9bc32..eedbba1 100644 --- a/.github/workflows/platforms.yml +++ b/.github/workflows/platforms.yml @@ -1,6 +1,6 @@ name: Test Cross Platform Support -on: [push] +on: [pull_request] jobs: action: @@ -12,6 +12,9 @@ jobs: name: Extract Example File on Ubuntu steps: - uses: actions/checkout@v2 + - uses: actions/setup-node@v3 + with: + node-version: 16 - name: Load action build from cache uses: actions/cache@v3 with: @@ -31,18 +34,14 @@ jobs: name: Extract Example File on macOS steps: - uses: actions/checkout@v2 - - name: Load action build from cache - uses: actions/cache@v3 + - uses: actions/setup-node@v3 with: - path: dist - key: build-${{ github.sha }} + node-version: 16 - name: Install Docker - env: - HOMEBREW_GITHUB_API_TOKEN: "${{ github.token }}" - run: | - brew install docker colima - colima start + uses: douglascamata/setup-docker-macos-action@v1-alpha.6 - run: docker build -t example:${{ github.sha }} ./.github/tests + - run: npm install + - run: npm run build - uses: ./ id: extract with: