Skip to content

Commit

Permalink
ci: only build the action once
Browse files Browse the repository at this point in the history
build it in the initial cache job and then share it as an artifact
  • Loading branch information
lazka authored and eine committed Jul 26, 2020
1 parent 96d323a commit f21c5b2
Showing 1 changed file with 51 additions and 88 deletions.
139 changes: 51 additions & 88 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,22 @@ jobs:
- run: |
npm ci
npm run lint
- uses: actions/upload-artifact@v2
with:
name: action
path: index.js

cache:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: build action
shell: bash
run: |
- run: |
npm ci
npm run pkg
rm -rf node_modules
- uses: actions/upload-artifact@v2
with:
name: action
path: index.js
- name: run action
uses: ./
with:
Expand All @@ -38,12 +43,9 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: build action
shell: bash
run: |
npm ci
npm run pkg
rm -rf node_modules
- uses: actions/download-artifact@v2
with:
name: action
- name: run action
uses: ./
- name: test MSYS
Expand All @@ -64,12 +66,9 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: build action
shell: bash
run: |
npm ci
npm run pkg
rm -rf node_modules
- uses: actions/download-artifact@v2
with:
name: action
- name: run action
uses: ./
- name: test MSYS
Expand All @@ -93,12 +92,9 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: build action
shell: bash
run: |
npm ci
npm run pkg
rm -rf node_modules
- uses: actions/download-artifact@v2
with:
name: action
- name: run action
uses: ./
- name: test MSYS
Expand All @@ -119,12 +115,9 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: build action
shell: bash
run: |
npm ci
npm run pkg
rm -rf node_modules
- uses: actions/download-artifact@v2
with:
name: action
- name: run action
uses: ./
- shell: msys2 {0}
Expand All @@ -139,12 +132,9 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: build action
shell: bash
run: |
npm ci
npm run pkg
rm -rf node_modules
- uses: actions/download-artifact@v2
with:
name: action
- name: run action
uses: ./
with:
Expand All @@ -161,12 +151,9 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: build action
shell: bash
run: |
npm ci
npm run pkg
rm -rf node_modules
- uses: actions/download-artifact@v2
with:
name: action
- name: run action
uses: ./
with:
Expand All @@ -180,12 +167,9 @@ jobs:
steps:
- uses: actions/setup-go@v1
- uses: actions/checkout@v2
- name: build action
shell: bash
run: |
npm ci
npm run pkg
rm -rf node_modules
- uses: actions/download-artifact@v2
with:
name: action
- name: run action
uses: ./
- run: msys2 -c "go env"
Expand All @@ -198,12 +182,9 @@ jobs:
steps:
- uses: actions/setup-go@v1
- uses: actions/checkout@v2
- name: build action
shell: bash
run: |
npm ci
npm run pkg
rm -rf node_modules
- uses: actions/download-artifact@v2
with:
name: action
- name: run action
uses: ./
with:
Expand All @@ -220,12 +201,9 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: build action
shell: bash
run: |
npm ci
npm run pkg
rm -rf node_modules
- uses: actions/download-artifact@v2
with:
name: action
- name: run action
uses: ./
with:
Expand All @@ -246,12 +224,9 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: build action
shell: bash
run: |
npm ci
npm run pkg
rm -rf node_modules
- uses: actions/download-artifact@v2
with:
name: action
- name: run action
uses: ./
with:
Expand All @@ -269,12 +244,9 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: build action
shell: bash
run: |
npm ci
npm run pkg
rm -rf node_modules
- uses: actions/download-artifact@v2
with:
name: action
- name: run action
uses: ./
with:
Expand All @@ -287,12 +259,9 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: build action
shell: bash
run: |
npm ci
npm run pkg
rm -rf node_modules
- uses: actions/download-artifact@v2
with:
name: action
- name: run action
uses: ./
- shell: msys2 {0}
Expand All @@ -305,12 +274,9 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: build action
shell: bash
run: |
npm ci
npm run pkg
rm -rf node_modules
- uses: actions/download-artifact@v2
with:
name: action
- name: run action
uses: ./
- shell: msys2 {0}
Expand All @@ -325,12 +291,9 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: build action
shell: bash
run: |
npm ci
npm run pkg
rm -rf node_modules
- uses: actions/download-artifact@v2
with:
name: action
- name: run action
uses: ./
with:
Expand Down

0 comments on commit f21c5b2

Please sign in to comment.