2023-08-01 16:22:27 +08:00
|
|
|
name: Gitea Actions Demo
|
|
|
|
on: [push]
|
|
|
|
jobs:
|
2023-08-01 18:41:05 +08:00
|
|
|
|
2023-08-01 16:22:27 +08:00
|
|
|
setup:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
|
|
|
image: catthehacker/ubuntu:act-latest
|
2023-08-01 18:41:05 +08:00
|
|
|
env:
|
|
|
|
RUNNER_TOOL_CACHE: /toolcache
|
2023-08-01 16:22:27 +08:00
|
|
|
steps:
|
2023-08-01 18:44:09 +08:00
|
|
|
- name: Checkout
|
2023-08-01 16:22:27 +08:00
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
2023-08-01 18:41:05 +08:00
|
|
|
fetch-depth: 1
|
|
|
|
|
|
|
|
- run: corepack enable
|
2023-08-01 16:22:27 +08:00
|
|
|
|
2023-08-01 21:27:53 +08:00
|
|
|
- name: Hash files
|
|
|
|
id: get-hash
|
2023-08-01 23:53:55 +08:00
|
|
|
uses: https://gitea.com/seepine/hash-files@v1
|
2023-08-01 23:48:11 +08:00
|
|
|
with:
|
2023-08-02 00:21:40 +08:00
|
|
|
patterns: |
|
|
|
|
**/yarn.lock
|
2023-08-02 00:22:50 +08:00
|
|
|
/package-lock.json
|
|
|
|
/*lock.*
|
2023-08-01 21:27:53 +08:00
|
|
|
|
2023-08-01 23:51:09 +08:00
|
|
|
- run: echo "${{ steps.get-hash.outputs.hash }}"
|
2023-08-01 23:49:27 +08:00
|
|
|
|
2023-08-01 23:51:09 +08:00
|
|
|
- run: echo "${{ runner.os }}"
|
2023-08-01 21:16:40 +08:00
|
|
|
|
2023-08-01 21:12:15 +08:00
|
|
|
- name: Cache node modules
|
|
|
|
uses: actions/cache@v3
|
2023-08-01 21:11:02 +08:00
|
|
|
with:
|
|
|
|
path: node_modules
|
2023-08-01 21:27:53 +08:00
|
|
|
key: ${{ runner.os }}-yarn-${{ steps.get-hash.outputs.hash }}
|
2023-08-01 21:11:02 +08:00
|
|
|
|
2023-08-01 18:41:05 +08:00
|
|
|
- name: Dependent installation
|
|
|
|
run: yarn install
|
|
|
|
|
|
|
|
test:
|
2023-08-01 16:22:27 +08:00
|
|
|
needs: setup
|
|
|
|
steps:
|
2023-08-01 21:11:02 +08:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 1
|
2023-08-01 18:41:05 +08:00
|
|
|
|
2023-08-01 21:12:15 +08:00
|
|
|
- name: Cache node modules
|
|
|
|
uses: actions/cache@v3
|
2023-08-01 20:51:02 +08:00
|
|
|
with:
|
2023-08-01 21:11:02 +08:00
|
|
|
path: node_modules
|
2023-08-02 00:11:07 +08:00
|
|
|
key: ${{ runner.os }}-yarn-${{ needs.setup.get-hash.outputs.hash }}
|
2023-08-01 20:51:02 +08:00
|
|
|
|
2023-08-01 21:11:02 +08:00
|
|
|
- name: Dependent installation
|
|
|
|
run: yarn install
|
2023-08-01 18:41:05 +08:00
|
|
|
|
|
|
|
build:
|
2023-08-01 16:22:27 +08:00
|
|
|
needs: setup
|
|
|
|
steps:
|
2023-08-01 21:12:15 +08:00
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 1
|
2023-08-01 18:41:05 +08:00
|
|
|
|
2023-08-01 21:12:15 +08:00
|
|
|
- name: Cache node modules
|
|
|
|
uses: actions/cache@v3
|
2023-08-01 20:51:02 +08:00
|
|
|
with:
|
2023-08-01 21:11:02 +08:00
|
|
|
path: node_modules
|
2023-08-02 00:11:07 +08:00
|
|
|
key: ${{ runner.os }}-yarn-${{ needs.setup.get-hash.outputs.hash }}
|
2023-08-01 20:51:02 +08:00
|
|
|
|
2023-08-01 21:11:02 +08:00
|
|
|
- name: Dependent installation
|
|
|
|
run: yarn install
|