name: 'test' on: pull_request: paths-ignore: - '**.md' tags-ignore: - '**' push: branches: - '**' paths-ignore: - '**.md' tags-ignore: - '**' workflow_dispatch: jobs: tests: name: ๐Ÿงช Test on ${{ matrix.os }}, .NET=${{ matrix.use-dotnet }} if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name runs-on: ${{ matrix.os }} strategy: # Don't cancel other OS runners if one fails. fail-fast: false matrix: # Put the operating systems you want to run on here. os: [ubuntu-latest, macos-latest, windows-latest] use-dotnet: [false, true] env: DOTNET_CLI_TELEMETRY_OPTOUT: true DOTNET_NOLOGO: true defaults: run: # Use bash shells on all platforms. shell: bash steps: - uses: actions/checkout@v3 name: ๐Ÿงพ Checkout - uses: actions/setup-dotnet@v3 if: ${{ matrix.use-dotnet }} name: ๐Ÿ’ฝ Setup .NET SDK with: dotnet-version: '6.0.x' - uses: ./ name: ๐Ÿค– Setup Godot with: # Version must include major, minor, and patch, and be >= 4.0.0 # Pre-release label is optional. version: 4.0.0 use-dotnet: ${{ matrix.use-dotnet }} - name: ๐Ÿ”ฌ Verify Dotnet if: ${{ matrix.use-dotnet }} run: | dotnet --version - name: ๐Ÿ”ฌ Verify Godot run: | godot --version test-global-json: name: ๐ŸŒ Test with version from global.json if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 name: ๐Ÿงพ Checkout - uses: ./ name: ๐Ÿค– Setup Godot with: version: global.json # Use the version specified in global.json use-dotnet: false - name: ๐Ÿ”ฌ Verify Godot run: | godot --version check-dist: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Set Node.js 16.x uses: actions/setup-node@v3 with: node-version: 16.x - name: Install dependencies run: npm ci - name: Rebuild the dist/ directory run: | npm run build npm run package - name: Compare the expected and actual dist/ directories run: | if [ "$(git diff --ignore-all-space --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then echo "Detected uncommitted changes after build. See status below:" git diff exit 1 fi id: diff # If index.js was different than expected, upload the expected version as an artifact - uses: actions/upload-artifact@v3 if: ${{ failure() && steps.diff.conclusion == 'failure' }} with: name: dist path: dist/