Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): unity in e2e environment #359

Merged
merged 39 commits into from
Jun 12, 2024
Merged
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
3a7087b
add publish pipeline
ComradeVanti Jun 9, 2024
123a440
run on pull
ComradeVanti Jun 9, 2024
32f2f29
use fixed action versions
ComradeVanti Jun 9, 2024
931e5d7
add missing v
ComradeVanti Jun 9, 2024
df88b80
fix incorrect dockerfile path
ComradeVanti Jun 9, 2024
652bf01
fix error in dockerfile
ComradeVanti Jun 9, 2024
706aedc
run build on corresponding os
ComradeVanti Jun 9, 2024
3bba23d
setup buildx
ComradeVanti Jun 9, 2024
0055321
Revert "run build on corresponding os"
ComradeVanti Jun 9, 2024
49d8dfa
Use other build push action
ComradeVanti Jun 9, 2024
0a6d32e
simplify image name
ComradeVanti Jun 9, 2024
1693486
drop windows dockerfile
ComradeVanti Jun 11, 2024
0a21030
Manually download
ComradeVanti Jun 11, 2024
842c691
wget no progress
ComradeVanti Jun 11, 2024
33d670c
Revert "drop windows dockerfile"
ComradeVanti Jun 11, 2024
614c3e1
add basic windows dockerfile
ComradeVanti Jun 11, 2024
6467d13
run windows installer
ComradeVanti Jun 11, 2024
564135b
change windows image
ComradeVanti Jun 11, 2024
f7e603f
windows env syntax
ComradeVanti Jun 11, 2024
9e66282
different env var style
ComradeVanti Jun 11, 2024
16b80b0
change env syntax
ComradeVanti Jun 11, 2024
6b5fa78
remove env variable
ComradeVanti Jun 11, 2024
ff49b92
incorrect curl flag
ComradeVanti Jun 11, 2024
2afa659
go to root
ComradeVanti Jun 11, 2024
8be36c5
change home syntax
ComradeVanti Jun 11, 2024
02da6a0
change path
ComradeVanti Jun 11, 2024
45590c5
full path
ComradeVanti Jun 11, 2024
6e77153
full path
ComradeVanti Jun 11, 2024
d6942ba
fix missing path
ComradeVanti Jun 11, 2024
e948a19
no silent
ComradeVanti Jun 12, 2024
05d795e
cmd start
ComradeVanti Jun 12, 2024
6cc15bf
lower unity version
ComradeVanti Jun 12, 2024
5149025
add paths
ComradeVanti Jun 12, 2024
a1a2084
change image name
ComradeVanti Jun 12, 2024
867d639
run tests on e2e image
ComradeVanti Jun 12, 2024
d3a7b49
ubuntu runner for 2e2
ComradeVanti Jun 12, 2024
44bcd7b
use latest tag
ComradeVanti Jun 12, 2024
0c99c7b
fix node setup
ComradeVanti Jun 12, 2024
eb36ba8
disable windows e2e
ComradeVanti Jun 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -19,24 +19,30 @@ jobs:
run: npm ci
- name: Unit tests
run: npm run test:unit

e2e-test:
runs-on: ubuntu-latest
container: ghcr.io/openupm/openupm-cli-e2e-${{ matrix.os }}:latest
strategy:
matrix:
node-version: [18.x]
os:
- ubuntu
# Seems like windows is not supported at the moment (06.2024)
# - windows
name: E2E Tests
steps:
- uses: actions/checkout@v3
- name: set node.js ${{ matrix.node-version }}
- name: setup node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
node-version: 18
- name: install deps
run: npm ci
- name: build
run: npm run build
- name: run tests
run: npx jest --testMatch "**/*.e2e.ts" --runInBand

release:
runs-on: ubuntu-latest
needs:
40 changes: 40 additions & 0 deletions .github/workflows/e2e-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish e2e images
on:
push:
paths:
- "docker/e2e/**"
- ".github/workflows/e2e-images.yml"

env:
REGISTRY: ghcr.io
IMAGE_NAME: e2e-${{ github.repository }}

jobs:
publish_e2e_images:
runs-on: ${{ matrix.os }}-latest

permissions:
contents: read
packages: write
attestations: write
id-token: write

strategy:
matrix:
os:
- ubuntu
- windows

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Build and push Docker image
uses: mr-smithers-excellent/docker-build-push@v6
with:
tags: latest
image: openupm-cli-e2e-${{matrix.os}}
dockerfile: docker/e2e/${{matrix.os}}/Dockerfile
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
17 changes: 17 additions & 0 deletions docker/e2e/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM ubuntu:latest as os
LABEL authors="comradevanti"

FROM os as install-os-deps

RUN apt-get -y update
RUN apt-get -y install wget
RUN apt-get -y install xz-utils

FROM install-os-deps as editor

ENV UNITY_VERSION=2021.3.36f1
RUN mkdir -p ~/Unity/Hub/Editor/${UNITY_VERSION}/Editor
RUN cd ~/Unity/Hub/Editor/${UNITY_VERSION}/Editor
RUN wget -O ./editor.tar.xz -q https://download.unity3d.com/download_unity/7a0645017be0/LinuxEditorInstaller/Unity-${UNITY_VERSION}.tar.xz
RUN tar -xJf ./editor.tar.xz
RUN rm ./editor.tar.xz
7 changes: 7 additions & 0 deletions docker/e2e/windows/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM mcr.microsoft.com/windows/nanoserver:ltsc2022 as os
LABEL authors="comradevanti"

FROM os as editor

RUN curl -o %userprofile%\UnitySetup64.exe https://download.unity3d.com/download_unity/7a0645017be0/Windows64EditorInstaller/UnitySetup64-2021.3.36f1.exe
RUN start %userprofile%\UnitySetup64.exe \S