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
|
|
|
|
|
2023-08-02 11:29:02 +08:00
|
|
|
- name: Corepack enable
|
|
|
|
run: corepack enable
|
|
|
|
|
|
|
|
- name: Hash files
|
|
|
|
id: get-hash
|
|
|
|
uses: seepine/hash-files@v1
|
|
|
|
with:
|
|
|
|
patterns: |
|
|
|
|
**/package.json
|
|
|
|
**/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
|
2023-08-01 18:41:05 +08:00
|
|
|
|
|
|
|
test:
|
2023-08-01 16:22:27 +08:00
|
|
|
needs: setup
|
2023-08-02 10:29:57 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
|
|
|
image: catthehacker/ubuntu:act-latest
|
|
|
|
env:
|
|
|
|
RUNNER_TOOL_CACHE: /toolcache
|
2023-08-01 16:22:27 +08:00
|
|
|
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-02 11:29:02 +08:00
|
|
|
- name: Corepack enable
|
|
|
|
run: corepack enable
|
|
|
|
|
|
|
|
- name: Hash files
|
|
|
|
id: get-hash
|
|
|
|
uses: seepine/hash-files@v1
|
|
|
|
with:
|
|
|
|
patterns: |
|
|
|
|
**/package.json
|
|
|
|
**/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
|
|
|
|
|
2023-08-02 11:08:34 +08:00
|
|
|
- name: Eslint Test
|
|
|
|
run: npx eslint --ext ".vue,.js,.jsx,.ts,.tsx"
|
2023-08-01 18:41:05 +08:00
|
|
|
|
|
|
|
build:
|
2023-08-01 16:22:27 +08:00
|
|
|
needs: setup
|
2023-08-02 10:25:48 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
|
|
|
image: catthehacker/ubuntu:act-latest
|
2023-08-02 09:35:18 +08:00
|
|
|
env:
|
2023-08-02 10:25:48 +08:00
|
|
|
RUNNER_TOOL_CACHE: /toolcache
|
2023-08-01 16:22:27 +08:00
|
|
|
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-02 11:29:02 +08:00
|
|
|
- name: Corepack enable
|
|
|
|
run: corepack enable
|
|
|
|
|
|
|
|
- name: Hash files
|
|
|
|
id: get-hash
|
|
|
|
uses: seepine/hash-files@v1
|
|
|
|
with:
|
|
|
|
patterns: |
|
|
|
|
**/package.json
|
|
|
|
**/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
|
|
|
|
|
2023-08-02 11:08:34 +08:00
|
|
|
- name: Eslint Test
|
|
|
|
run: npx eslint --ext ".vue,.js,.jsx,.ts,.tsx"
|