Skip to content

feat: discover all recent Unity versions from releases page #405

feat: discover all recent Unity versions from releases page

feat: discover all recent Unity versions from releases page #405

Workflow file for this run

name: 🚀
on:
pull_request: {}
push: { branches: [main] }
jobs:
test:
name: 🧪 Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Read Node version from mise.toml
id: node
run: echo "version=$(grep -E '^node\s*=' mise.toml | sed -E 's/.*"([^"]+)".*/\1/')" >>
"$GITHUB_OUTPUT"
- name: Install package manager (from package.json)
run: |
corepack enable
corepack install
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ steps.node.outputs.version }}
- name: Resolve yarn cache folder
id: yarn-config
run: echo "cacheFolder=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT"
- name: Restore yarn install cache (node_modules + cacheFolder + install-state)
id: yarn-cache
uses: actions/cache@v4
with:
path: |
node_modules
${{ steps.yarn-config.outputs.cacheFolder }}
.yarn/install-state.gz
key: yarn-${{ runner.os }}-node${{ steps.node.outputs.version }}-${{
hashFiles('yarn.lock') }}
restore-keys: |
yarn-${{ runner.os }}-node${{ steps.node.outputs.version }}-
- name: Install deps
env:
YARN_ENABLE_HARDENED_MODE: 'false'
run: |
case "$(yarn --version)" in 1.*) echo 'expected up-to-date yarn version'; exit 1 ;; esac
yarn install --immutable
- name: Format
run: yarn format:check
- name: Lint
run: yarn lint
- name: Typecheck
run: yarn typecheck
- name: Test
run: yarn coverage
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: game-ci/versioning-backend
files: ./functions/coverage/lcov.info
flags: unittests,integration
build:
name: 🛠 Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Read Node version from mise.toml
id: node
run: echo "version=$(grep -E '^node\s*=' mise.toml | sed -E 's/.*"([^"]+)".*/\1/')" >>
"$GITHUB_OUTPUT"
- name: Install package manager (from package.json)
run: |
corepack enable
corepack install
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ steps.node.outputs.version }}
- name: Resolve yarn cache folder
id: yarn-config
run: echo "cacheFolder=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT"
- name: Restore yarn install cache (node_modules + cacheFolder + install-state)
id: yarn-cache
uses: actions/cache@v4
with:
path: |
node_modules
${{ steps.yarn-config.outputs.cacheFolder }}
.yarn/install-state.gz
key: yarn-${{ runner.os }}-node${{ steps.node.outputs.version }}-${{
hashFiles('yarn.lock') }}
restore-keys: |
yarn-${{ runner.os }}-node${{ steps.node.outputs.version }}-
- name: Install deps
env:
YARN_ENABLE_HARDENED_MODE: 'false'
run: |
case "$(yarn --version)" in 1.*) echo 'expected up-to-date yarn version'; exit 1 ;; esac
yarn install --immutable
- name: build
run: yarn workspace functions build
testDeploy:
name: Test Deploy
needs: [test, build]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Read Node version from mise.toml
id: node
run: echo "version=$(grep -E '^node\s*=' mise.toml | sed -E 's/.*"([^"]+)".*/\1/')" >>
"$GITHUB_OUTPUT"
- name: Install package manager (from package.json)
run: |
corepack enable
corepack install
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ steps.node.outputs.version }}
- name: Resolve yarn cache folder
id: yarn-config
run: echo "cacheFolder=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT"
- name: Restore yarn install cache (node_modules + cacheFolder + install-state)
id: yarn-cache
uses: actions/cache@v4
with:
path: |
node_modules
${{ steps.yarn-config.outputs.cacheFolder }}
.yarn/install-state.gz
key: yarn-${{ runner.os }}-node${{ steps.node.outputs.version }}-${{
hashFiles('yarn.lock') }}
restore-keys: |
yarn-${{ runner.os }}-node${{ steps.node.outputs.version }}-
- name: Install deps
env:
YARN_ENABLE_HARDENED_MODE: 'false'
run: |
case "$(yarn --version)" in 1.*) echo 'expected up-to-date yarn version'; exit 1 ;; esac
yarn install --immutable
- name: Deploy test to Firebase
uses: w9jds/firebase-action@v14.19.0
with:
args: help ; corepack enable ; corepack install ; firebase deploy --only functions:testFunction --force
env:
GCP_SA_KEY: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_UNITY_CI_VERSIONS }}'
- name: Cleanup Firebase Test
uses: w9jds/firebase-action@v14.19.0
if: always()
with:
args: help ; corepack enable ; corepack install ; firebase functions:delete testFunction --force
env:
GCP_SA_KEY: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_UNITY_CI_VERSIONS }}'
deploy:
name: ✨ Deploy
needs: [test, build, testDeploy]
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Read Node version from mise.toml
id: node
run: echo "version=$(grep -E '^node\s*=' mise.toml | sed -E 's/.*"([^"]+)".*/\1/')" >>
"$GITHUB_OUTPUT"
- name: Install package manager (from package.json)
run: |
corepack enable
corepack install
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ steps.node.outputs.version }}
- name: Resolve yarn cache folder
id: yarn-config
run: echo "cacheFolder=$(yarn config get cacheFolder)" >> "$GITHUB_OUTPUT"
- name: Restore yarn install cache (node_modules + cacheFolder + install-state)
id: yarn-cache
uses: actions/cache@v4
with:
path: |
node_modules
${{ steps.yarn-config.outputs.cacheFolder }}
.yarn/install-state.gz
key: yarn-${{ runner.os }}-node${{ steps.node.outputs.version }}-${{
hashFiles('yarn.lock') }}
restore-keys: |
yarn-${{ runner.os }}-node${{ steps.node.outputs.version }}-
- name: Install deps
env:
YARN_ENABLE_HARDENED_MODE: 'false'
run: |
case "$(yarn --version)" in 1.*) echo 'expected up-to-date yarn version'; exit 1 ;; esac
yarn install --immutable
- name: Deploy to Firebase
uses: w9jds/firebase-action@v14.19.0
with:
args: help ; corepack enable ; corepack install ; firebase deploy
env:
GCP_SA_KEY: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_UNITY_CI_VERSIONS }}'
- name: Cleanup Firebase Test
uses: w9jds/firebase-action@v14.19.0
if: always()
with:
args: help ; corepack enable ; corepack install ; firebase functions:delete testFunction --force
env:
GCP_SA_KEY: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_UNITY_CI_VERSIONS }}'