102 lines
2.4 KiB
YAML
102 lines
2.4 KiB
YAML
name: Gitea Actions Demo
|
|
on: [push]
|
|
jobs:
|
|
|
|
setup:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: catthehacker/ubuntu:act-latest
|
|
env:
|
|
RUNNER_TOOL_CACHE: /toolcache
|
|
outputs:
|
|
hash: ${{ steps.get-hash.outputs.hash }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
# - run: corepack enable
|
|
- run: node -v
|
|
|
|
- run: yarn -v
|
|
|
|
- name: Hash files
|
|
id: get-hash
|
|
uses: https://gitea.com/seepine/hash-files@v1
|
|
with:
|
|
patterns: |
|
|
**/yarn.lock
|
|
|
|
- run: echo "${{ steps.get-hash.outputs.hash }}"
|
|
|
|
- run: echo "${{ runner.os }}"
|
|
|
|
- name: Cache node modules
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: node_modules
|
|
key: ${{ runner.os }}-yarn-${{ steps.get-hash.outputs.hash }}
|
|
|
|
- name: Dependent installation
|
|
run: yarn install
|
|
|
|
test:
|
|
needs: setup
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Hash files
|
|
id: get-hash
|
|
uses: https://gitea.com/seepine/hash-files@v1
|
|
with:
|
|
patterns: |
|
|
**/yarn.lock
|
|
|
|
- name: Cache node modules
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: node_modules
|
|
key: ${{ runner.os }}-yarn-${{ steps.get-hash.outputs.hash }}
|
|
|
|
- name: Dependent installation
|
|
run: yarn install
|
|
|
|
build:
|
|
needs: setup
|
|
env:
|
|
- HASH: needs.setup.outputs.hash
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Hash files
|
|
id: get-hash
|
|
uses: https://gitea.com/seepine/hash-files@v1
|
|
with:
|
|
patterns: |
|
|
**/yarn.lock
|
|
|
|
- run: echo "${{ env.HASH }}"
|
|
- run: echo "${{ workflows.setup.steps.get-hash.outputs.hash }}"
|
|
- run: echo "${{ workflows.setup.outputs.hash }}"
|
|
|
|
- run: echo "${{ needs.setup.steps.get-hash.outputs.hash }}"
|
|
- run: echo "${{ needs.setup.outputs.hash }}"
|
|
- run: echo "${{ steps.get-hash.outputs.hash }}"
|
|
- run: echo "${{ outputs.hash }}"
|
|
|
|
- name: Cache node modules
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: node_modules
|
|
key: ${{ runner.os }}-yarn-${{ steps.get-hash.outputs.hash }}
|
|
|
|
- name: Dependent installation
|
|
run: yarn install
|