mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2025-12-06 15:22:47 +01:00
Setup CI cache (#46)
This commit is contained in:
54
.github/workflows/ci.yml
vendored
54
.github/workflows/ci.yml
vendored
@@ -15,7 +15,23 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/setup-go@v3
|
||||
with: { go-version: '1.18' }
|
||||
|
||||
- id: goenv
|
||||
run: |
|
||||
echo "::set-output name=gocache::$(go env GOCACHE)"
|
||||
echo "::set-output name=gomodcache::$(go env GOMODCACHE)"
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ steps.goenv.outputs.gocache }}
|
||||
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ steps.goenv.outputs.gomodcache }}
|
||||
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
|
||||
|
||||
- run: |
|
||||
mkdir -p ui/dist/img
|
||||
touch ui/dist/index.html ui/dist/favicon.ico ui/dist/manifest.json ui/dist/img/fake.png
|
||||
@@ -30,7 +46,23 @@ jobs:
|
||||
with: { go-version: '1.18' }
|
||||
- uses: actions/setup-node@v2
|
||||
with: { node-version: '14' }
|
||||
|
||||
- id: goenv
|
||||
run: |
|
||||
echo "::set-output name=gocache::$(go env GOCACHE)"
|
||||
echo "::set-output name=gomodcache::$(go env GOMODCACHE)"
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ steps.goenv.outputs.gocache }}
|
||||
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ steps.goenv.outputs.gomodcache }}
|
||||
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
|
||||
|
||||
- run: |
|
||||
mkdir -p ui/dist/img
|
||||
touch ui/dist/index.html ui/dist/favicon.ico ui/dist/manifest.json ui/dist/img/fake.png
|
||||
@@ -52,6 +84,12 @@ jobs:
|
||||
- uses: actions/setup-node@v2
|
||||
with: { node-version: '14' }
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: '**/node_modules'
|
||||
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
|
||||
|
||||
- run: yarn install && yarn build
|
||||
working-directory: ui
|
||||
- uses: actions/upload-artifact@v2
|
||||
@@ -65,7 +103,23 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/setup-go@v3
|
||||
with: { go-version: '1.18' }
|
||||
|
||||
- id: goenv
|
||||
run: |
|
||||
echo "::set-output name=gocache::$(go env GOCACHE)"
|
||||
echo "::set-output name=gomodcache::$(go env GOMODCACHE)"
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ steps.goenv.outputs.gocache }}
|
||||
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }}
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ steps.goenv.outputs.gomodcache }}
|
||||
key: ${{ runner.os }}-go-mod-${{ hashFiles('**/go.sum') }}
|
||||
|
||||
- uses: actions/download-artifact@v2
|
||||
with: { name: ui, path: ui/dist }
|
||||
- run: go build -o catalyst ./cmd/catalyst/.
|
||||
|
||||
Reference in New Issue
Block a user