diff --git a/.github/actions/setup-yarn/action.yml b/.github/actions/setup-yarn/action.yml new file mode 100644 index 000000000..e1b50ee29 --- /dev/null +++ b/.github/actions/setup-yarn/action.yml @@ -0,0 +1,20 @@ +name: Setup Yarn +description: Common setup steps for most workflows in the Omega Flowey Remastered repository + +runs: + using: composite + steps: + - uses: tw3lveparsecs/github-actions-set-variables@v0.2 + with: + envFilePath: ./.github/variables/shared.env + - name: Install Yarn 3.6.3 + run: corepack enable + shell: bash + - name: Setup cache + uses: actions/setup-node@v4 + with: + cache: 'yarn' + cache-dependency-path: yarn.lock + node-version-file: package.json + - run: yarn + shell: bash diff --git a/.github/workflows/datapack.yml b/.github/workflows/datapack.yml index da50ab146..38f00a0bb 100644 --- a/.github/workflows/datapack.yml +++ b/.github/workflows/datapack.yml @@ -12,18 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: tw3lveparsecs/github-actions-set-variables@v0.2 - with: - envFilePath: ./.github/variables/shared.env - - name: Install Yarn 3.6.3 - run: corepack enable - - name: Setup cache - uses: actions/setup-node@v4 - with: - cache: 'yarn' - cache-dependency-path: yarn.lock - node-version-file: package.json - - run: yarn + - uses: ./.github/actions/setup-yarn - name: Run lint scripts on datapacks run: yarn start lint.custom.datapacks env: diff --git a/.github/workflows/resourcepack.yml b/.github/workflows/resourcepack.yml index 3c408cd7d..fd935d698 100644 --- a/.github/workflows/resourcepack.yml +++ b/.github/workflows/resourcepack.yml @@ -7,18 +7,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: tw3lveparsecs/github-actions-set-variables@v0.2 - with: - envFilePath: ./.github/variables/shared.env - - name: Install Yarn 3.6.3 - run: corepack enable - - name: Setup cache - uses: actions/setup-node@v4 - with: - cache: 'yarn' - cache-dependency-path: yarn.lock - node-version-file: package.json - - run: yarn + - uses: ./.github/actions/setup-yarn - name: Run lint scripts on resourcepack run: yarn start lint.custom.resourcepack env: diff --git a/.github/workflows/scripts.yml b/.github/workflows/scripts.yml index 930bdb119..f265fa541 100644 --- a/.github/workflows/scripts.yml +++ b/.github/workflows/scripts.yml @@ -7,18 +7,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: tw3lveparsecs/github-actions-set-variables@v0.2 - with: - envFilePath: ./.github/variables/shared.env - - name: Install Yarn 3.6.3 - run: corepack enable - - name: Setup cache - uses: actions/setup-node@v4 - with: - cache: 'yarn' - cache-dependency-path: yarn.lock - node-version-file: package.json - - run: yarn + - uses: ./.github/actions/setup-yarn - name: Run Prettier run: yarn start lint.scripts.prettier.check @@ -27,18 +16,7 @@ jobs: needs: format steps: - uses: actions/checkout@v4 - - uses: tw3lveparsecs/github-actions-set-variables@v0.2 - with: - envFilePath: ./.github/variables/shared.env - - name: Install Yarn 3.6.3 - run: corepack enable - - name: Setup cache - uses: actions/setup-node@v4 - with: - cache: 'yarn' - cache-dependency-path: yarn.lock - node-version-file: package.json - - run: yarn + - uses: ./.github/actions/setup-yarn - name: Run ESLint run: yarn start lint.scripts.eslint.check - name: Run custom lint scripts on non-datapacks, non-resourcepack files