huanghs 17c2f8bb68
Some checks reported warnings
Gitea Actions Demo / setup (push) Successful in 19s
Gitea Actions Demo / Gitea-Actions (push) Successful in 18s
Gitea Actions Demo / build (push) Successful in 2m52s
Gitea Actions Demo / test (push) Has been cancelled
更新 .gitea/workflows/multiple.yml
2023-08-02 00:14:05 +08:00

90 lines
1.9 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
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
- run: corepack enable
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
- 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: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
- name: Cache node modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ needs.setup.get-hash.outputs.hash }}
- name: Dependent installation
run: yarn install
build:
needs: setup
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
- name: Cache node modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ needs.setup.get-hash.outputs.hash }}
- name: Dependent installation
run: yarn install