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

[SG] Add support for Source Generator #2958

Merged
merged 256 commits into from
Nov 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
256 commits
Select commit Hold shift + click to select a range
07aee2a
Various improvements
papafe Mar 3, 2022
f170a68
Merge branch 'fp/source-generators' of https://github.com/realm/realm…
papafe Mar 3, 2022
a273c62
Added benchmarks
papafe Mar 3, 2022
032846c
Merge branch 'main' into fp/source-generators
papafe Mar 18, 2022
2783a64
Added different files
papafe Mar 23, 2022
e6a61bd
First step
papafe Mar 23, 2022
50d2544
Corrected tests
papafe Mar 23, 2022
83726db
Moved files around
papafe Mar 23, 2022
513a42a
Corrected notifications
papafe Mar 23, 2022
4272f24
Various corrections
papafe Mar 25, 2022
36331ef
Small corrections
papafe Mar 28, 2022
b92c1e7
Revert "Added benchmarks"
papafe Mar 28, 2022
7f358d4
Small correction
papafe Mar 28, 2022
a04d735
Fixed IThreadConfined
papafe Mar 28, 2022
9f1ca52
Moved object equality
papafe Mar 30, 2022
506100d
Various improvements
papafe Mar 31, 2022
ea0507c
Corrections
papafe Apr 1, 2022
67b9a3d
Corrected accessor
papafe Apr 1, 2022
25282bc
Good batch of changes
papafe Apr 1, 2022
240d3f9
Corrections
papafe Apr 1, 2022
e3894bf
Fixed some warnings
papafe Apr 7, 2022
55e7d5a
Added notes
papafe Apr 7, 2022
bc0a280
First corrections
papafe Apr 8, 2022
bb1b9ff
Added comment
papafe Apr 8, 2022
5a323ce
Small correction
papafe Apr 8, 2022
6f7750b
Corrections
papafe Apr 8, 2022
6492f07
Fixed hash code [skip ci]
papafe Apr 8, 2022
d09865c
Removed unnecessary from realm accessor
papafe Apr 8, 2022
2fd9c31
Fixed dynamic api [skip ci]
papafe Apr 8, 2022
34a1703
Multiple improvements
papafe Apr 11, 2022
e86851c
Corrected dynamic object
papafe Apr 11, 2022
4a92e40
Corrected dynamic [skip ci]
papafe Apr 11, 2022
61ba194
Improvements [skip ci]
papafe Apr 12, 2022
ca1e488
Added setManagedAccessor
papafe Apr 12, 2022
205f75e
Moved metadata out [skip ci]
papafe Apr 12, 2022
2f73fb7
Merge branch 'main' into fp/extract-accessor
papafe Apr 12, 2022
2384a16
Corrected dynamic obj
papafe Apr 13, 2022
dcc9323
Removed unnessary field
papafe May 3, 2022
ec494b6
Improvements
papafe May 5, 2022
5021e8f
Fixed IRealmObjectHelper - Fody
papafe May 5, 2022
5e5512b
Corrected accessors
papafe May 6, 2022
40430fd
Fixed weaver tests
papafe May 6, 2022
a1da4d7
Fixed IReflectableType
papafe May 6, 2022
21b3d1e
Fixes
papafe May 6, 2022
12cc59b
Merge branch 'main' into fp/extract-accessor
papafe May 6, 2022
79e25e6
Small improvements
papafe May 9, 2022
a213b2a
Rename to IRealmObjectBase
papafe May 9, 2022
fd9ce51
Fixed rename
papafe May 9, 2022
e837d86
Corrected operator
papafe May 9, 2022
c406b65
Fixed realm value
papafe May 9, 2022
605c47f
Corrected weaver tests
papafe May 10, 2022
2287b95
Small corrections
papafe May 10, 2022
8c1a68c
Removed unused parts of unmanaged accessor
papafe May 10, 2022
98945bb
Corrected unmanaged accessor
papafe May 10, 2022
4d04442
Converting RealmObject to IRealmObject
papafe May 10, 2022
9ada93a
Converted EmbeddedObject to IEmbeddedObject
papafe May 10, 2022
068cb15
First batch of fixes due to PR
papafe May 11, 2022
556d458
Use the csproj from master [skip-ci]
papafe May 11, 2022
aa7da10
Revert "Use the csproj from master [skip-ci]"
papafe May 11, 2022
1245cbc
Restored correct proj file
papafe May 11, 2022
2390253
Several corrections
papafe May 11, 2022
e4904cc
Added correction [skip-ci]
papafe May 11, 2022
9390667
Corrections
papafe May 12, 2022
1c80547
Corrected objectEquals and ToString
papafe May 12, 2022
521c546
Final fixes according to PR
papafe May 12, 2022
8e4fde9
Addes sg project
papafe May 19, 2022
b8d4ff9
Added scaffolding
papafe May 20, 2022
5431465
Fixed redirect
papafe May 23, 2022
7a5b719
Modified proj file
papafe May 23, 2022
a1c79cb
Corrected for Unity
papafe May 23, 2022
b00470b
Added meta files
papafe May 23, 2022
97e0f52
Added docs
papafe May 25, 2022
cbc5be4
Small correction
papafe May 30, 2022
f09effb
Merge branch 'fp/extract-accessor' into fp/sg-scaffolding
papafe May 30, 2022
5b645ad
Added base test
papafe May 30, 2022
a0fb63d
Corrections
papafe Jun 1, 2022
637c162
Addeda manually generated class
papafe Jun 1, 2022
ead837d
Added minimum tests
papafe Jun 1, 2022
3b1c013
Small corrections
papafe Jun 2, 2022
cde6871
Small changes
papafe Jun 3, 2022
ab73038
Small things
papafe Jun 3, 2022
0efa5ad
Have fun with the SG scaffolding (#2947)
nirinchev Jun 3, 2022
248861a
Small changes + notes
papafe Jun 3, 2022
9bf8978
Added mapTo and primary key
papafe Jun 10, 2022
b9672af
Corrected schema generation
papafe Jun 10, 2022
098a5f0
Added notes
papafe Jun 10, 2022
7f794d5
Added comment
papafe Jun 13, 2022
da3ef18
Corrections
papafe Jun 14, 2022
45c5bd6
Small corrections
papafe Jun 15, 2022
e5077cb
Merge branch 'main' into fp/sg-scaffolding
papafe Jun 15, 2022
1c9aac0
Correction according to PR
papafe Jun 15, 2022
15ec10e
Corrections [skip-ci]
papafe Jun 15, 2022
76ec86d
Added diagnostics in seaparate file
papafe Jun 15, 2022
eda31de
Refactoring
papafe Jun 15, 2022
385b282
Various corrections [skip ci]
papafe Jun 16, 2022
1fccc11
corrected diagnostic
papafe Jun 16, 2022
6316656
Fixes for diagnostic
papafe Jun 16, 2022
b655529
Added all possible diagnostics [skip ci]
papafe Jun 16, 2022
53a2041
Corrections [skip ci]
papafe Jun 17, 2022
450491a
Refactoring [skip ci]
papafe Jun 17, 2022
4288da0
Fixed several things
papafe Jun 17, 2022
3b50eb2
Fixes [skip ci]
papafe Jun 17, 2022
45b4cc2
Added diagnostic testing [skip ci]
papafe Jun 20, 2022
f636085
Corrected diagnostics [skip ci]
papafe Jun 24, 2022
b04b747
Corrected string
papafe Jun 27, 2022
1d33246
Added comment
papafe Jun 27, 2022
20e1f86
Small corrections [skip ci]
papafe Jun 27, 2022
48c23b1
Added playground
papafe Jun 27, 2022
451a4b0
Removed propertyType
papafe Jun 28, 2022
43396f7
Removed dependency on Realm [skip ci]
papafe Jun 28, 2022
f25575f
Added check for indexable [skip ci]
papafe Jun 28, 2022
ff9d1b6
Added test for indexed, primary key and so on [skip ci]
papafe Jun 28, 2022
3483a1c
Added severak diagnostics [skip ci]
papafe Jun 30, 2022
903cf22
Added fixes [skip ci]
papafe Jul 1, 2022
67a5b8c
Small additions
papafe Jul 4, 2022
b9884c2
Added various test files [skip ci]
papafe Jul 4, 2022
60b0d36
Added diagnostic serialization
papafe Jul 5, 2022
626ac9f
Fix [skip ci]
papafe Jul 5, 2022
6a75241
Divided test classes
papafe Jul 6, 2022
6c3aa89
Various corrections
papafe Jul 6, 2022
80f3238
Added more diagnostics [skip ci]
papafe Jul 6, 2022
676e261
Rename [skip ci]
papafe Jul 7, 2022
59ab9f7
Added reference to newtonsoft
papafe Jul 7, 2022
5e42ed4
Small fix
papafe Jul 7, 2022
0216917
Small correction
papafe Jul 7, 2022
004da09
Added check on nullability [skip ci]
papafe Jul 8, 2022
ff56d1e
Fixed diagnostic testing [skip ci]
papafe Jul 8, 2022
59ef224
Added intiial generation [skip ci]
papafe Jul 12, 2022
8d673f8
Improved generation and moved files around [skip ci]
papafe Jul 13, 2022
60ce697
Moved files around
papafe Jul 13, 2022
90b8d54
Corrected generator [skip ci]
papafe Jul 13, 2022
7a6d25b
Imrpvoed formatting [skip ci]
papafe Jul 14, 2022
25c01a1
Uniformed spacing [skip ci]
papafe Jul 14, 2022
b11b3eb
Fixes
papafe Jul 15, 2022
b2c4ce2
Renamed namespace [skip ci]
papafe Jul 15, 2022
94bc79d
Various corrections [skip ci]
papafe Jul 26, 2022
096bbb3
Small fix
papafe Jul 26, 2022
a2e87a3
Fixed schema definition and added collection properties generation
papafe Jul 26, 2022
f1f8d11
Added newly generated [skip ci]
papafe Jul 26, 2022
31f6f5a
Small fixes [skip ci]
papafe Jul 27, 2022
03a80d9
Added fix for backlinks [skip ci]
papafe Jul 27, 2022
8bca4a4
Corrected spaces and added implicit/explicti conversion [skip ci]
papafe Jul 27, 2022
bcc56c1
Corrected schema
papafe Jul 28, 2022
2dbb48e
Fixed formatting [skip ci]
papafe Jul 28, 2022
cf7bae5
Start working on weaving [skip ci]
papafe Jul 29, 2022
8ac7243
Added tests for weaver stub [skip ci]
papafe Aug 1, 2022
7c17208
Corrected weaver and tests [skip ci]
papafe Aug 1, 2022
5bca6a2
Corrected weaving [skip ci]
papafe Aug 3, 2022
bc8d13f
Small refactoring [skip ci]
papafe Aug 3, 2022
688f27b
Small renaming
papafe Aug 10, 2022
9c9bbf6
Small corrections [skip ci]
papafe Aug 10, 2022
d04f660
Added proj [skip ci]
papafe Aug 10, 2022
a7d8e53
Small correction
papafe Aug 11, 2022
e1e2cb6
Several corrections
papafe Aug 11, 2022
f76f27f
Various corrections [skip ci]
papafe Aug 11, 2022
62632d3
Small fixes [skip ci]
papafe Aug 12, 2022
b887691
Small fixes [skip ci]
papafe Aug 12, 2022
5fad00a
Generated files [skip ci]
papafe Aug 12, 2022
639ebe7
Improved comments and cleaning [skip ci]
papafe Aug 12, 2022
d5bfe7e
Removed diagnostic info [skip ci]
papafe Aug 12, 2022
549c106
Comments
papafe Aug 15, 2022
2a8953b
Created new folder for testing [skip ci]
papafe Aug 15, 2022
90d8356
Added projects
papafe Aug 15, 2022
8d7ca3b
Small improvements
papafe Aug 15, 2022
ab027f5
Small corrections
papafe Aug 15, 2022
116110d
Removed unused (finished moving the source generation testing out) [s…
papafe Aug 15, 2022
9e76e65
Added default usings [skip ci]
papafe Aug 15, 2022
c8ec098
First batch of fixes
papafe Aug 16, 2022
fbed1ec
Update Realm/Realm.SourceGenerator/Diagnostics.cs
papafe Aug 16, 2022
fb1360b
Corrected copyright
papafe Aug 16, 2022
e1e0478
Corrected remaning copyright
papafe Aug 16, 2022
4f4df0e
Corrected diagnostics
papafe Aug 16, 2022
9bd831c
Small fixes [skip ci]
papafe Aug 16, 2022
f6f6caa
Merge branch 'fp/sg-scaffolding' of https://github.com/realm/realm-do…
papafe Aug 16, 2022
5499300
Multiple fixes
papafe Aug 16, 2022
d31e9ab
Added more fixes
papafe Aug 16, 2022
8adc4ea
Code style [skip ci]
papafe Aug 16, 2022
29c2708
Small fixes [skip ci]
papafe Aug 16, 2022
bdfb62b
Small correction for testing [skip ci]
papafe Aug 16, 2022
f44f00e
Added readme and fixed diagnostics [skip ci]
papafe Aug 17, 2022
e51bdb1
Small fixes [skip ci]
papafe Aug 17, 2022
16ab7cf
Updated stylecop
papafe Aug 17, 2022
0726dc2
Big refactoring [skip ci]
papafe Aug 17, 2022
88422cd
Small fixes
papafe Aug 18, 2022
f017e27
Big refactoring [skip ci]
papafe Aug 18, 2022
079b2cb
Small fixes [skip ci]
papafe Aug 18, 2022
83994d1
Small test refactoring [skip ci]
papafe Aug 19, 2022
84d5ac6
Testing corrections [skip ci]
papafe Aug 22, 2022
97f23f2
Corrected testing [skip ci]
papafe Aug 22, 2022
ab3421c
Added support for default values [skip ci]
papafe Aug 24, 2022
0bf9923
Small correction [skip ci]
papafe Aug 24, 2022
3980dff
Added support for namespaces [skip ci]
papafe Aug 24, 2022
dbb8b5f
Minor Parser adjustments (#3004)
nirinchev Aug 24, 2022
7769f5e
Small note [skip ci]
papafe Aug 24, 2022
7b71100
Added fix for partial classes [skip ci]
papafe Aug 24, 2022
f28fc08
[SG] Diagnostics tweaks (#3005)
nirinchev Aug 25, 2022
0d8669c
Small fix to code builder [skip ci]
papafe Aug 25, 2022
a503b73
Small correction [skip ci]
papafe Aug 25, 2022
d66a792
Removed unnecessary method [skip ci]
papafe Aug 25, 2022
c9ae528
Added docs [skip ci]
papafe Aug 26, 2022
abd8f18
Added missing docs [skip ci]
papafe Aug 26, 2022
ebf3dd8
Removed unused
papafe Aug 26, 2022
b3f04dd
Small fixes
papafe Aug 26, 2022
9196ed0
Various fixes [skip ci]
papafe Aug 26, 2022
ffc6b60
Corrected parsing of non automatic properties [skip ci]
papafe Aug 26, 2022
f73b166
Corrected backlink handling [skip ci]
papafe Aug 26, 2022
ebc44b4
Fixed accessibility [skip ci]
papafe Aug 26, 2022
75958a5
Add some indenting capabilities to the SG (#3010)
nirinchev Aug 29, 2022
d52c423
Corrected spacing
papafe Aug 29, 2022
0f00d3c
Small improvement to indentation [skip ci]
papafe Aug 29, 2022
4e42f27
Small corrections [skip ci]
papafe Aug 29, 2022
fa0b6ba
Added support for parameterless constructor [skip ci]
papafe Aug 29, 2022
0e89d25
Corrected manually generated class
papafe Aug 30, 2022
21b1579
Fixed tests [skip ci]
papafe Aug 30, 2022
8a941fd
Corrected indentation [skip ci]
papafe Aug 30, 2022
1706f42
Added support for enclosing classes
papafe Aug 30, 2022
01d439e
Corrected parameterless constructor [skip ci]
papafe Aug 30, 2022
d229ef3
Fixed manually generated class
papafe Sep 1, 2022
ca2a306
Fixed manually generated class
papafe Sep 1, 2022
dc7847b
Revert "Fixed manually generated class"
papafe Sep 1, 2022
e2da6cf
Revert "Revert "Fixed manually generated class""
papafe Sep 1, 2022
755fc56
Merge
papafe Sep 1, 2022
8fe939d
Corrected weaver and accessor [skip ci]
papafe Sep 1, 2022
478828a
Corrected builder
papafe Sep 1, 2022
81cc91a
Added missing methods to class builder [skip ci]
papafe Sep 1, 2022
56c90d4
First batch of corrections according to PR [skip ci]
papafe Sep 2, 2022
f68e40e
Second batch of corrections according to PR [skip ci]
papafe Sep 2, 2022
96ea63f
Removed comments and wpf bug line [skip ci]
papafe Sep 2, 2022
88302d3
Corrected nullability
papafe Sep 2, 2022
7c61c8e
Moved IQueryable to be a collection type (and now it's called backlin…
papafe Sep 2, 2022
a33fea6
Corrected naming [skip ci]
papafe Sep 2, 2022
035990d
Correction to operator
papafe Sep 2, 2022
8922f32
Added code for copyToRealm [skip ci]
papafe Sep 2, 2022
2c78ce4
Corrected accessor assignment [skip ci]
papafe Sep 2, 2022
b14aa68
Added corrections from testing branch
papafe Sep 30, 2022
1c54ad8
Merge branch 'main' into fp/sg-scaffolding
papafe Sep 30, 2022
d2de1f4
Update Realm/Realm.SourceGenerator/ClassCodeBuilder.cs
papafe Oct 4, 2022
4d5f6f3
Manual merge from sg-testing
papafe Oct 4, 2022
44f8e4b
Corrections according to PR
papafe Oct 4, 2022
203452d
Corrected generated classes in test assembly
papafe Oct 4, 2022
cec71ec
Corrections according to PR
papafe Oct 7, 2022
b2cab6c
Merge branch 'main' into fp/sg-scaffolding
papafe Oct 7, 2022
aac36bc
Small correction
papafe Oct 7, 2022
73aa275
Fixed maui project
papafe Oct 7, 2022
a1d6f56
Fixed core version
papafe Oct 7, 2022
20adca1
[SG] Conversion of tests to use source generators (#3025)
papafe Oct 26, 2022
4d8c53c
Merge branch 'main' into fp/sg-scaffolding
papafe Oct 26, 2022
1dc6098
Corrected embedded obj
papafe Oct 27, 2022
50b39e5
Small code quality corrections
papafe Oct 27, 2022
6fd2da9
Merge branch 'main' into fp/sg-scaffolding
papafe Oct 31, 2022
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
18 changes: 18 additions & 0 deletions .github/templates/build.lib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,24 @@ test-net-core:
framework: #@ frameworks
#@ end

#@ def runWovenClassesTests():
test-weaved-classes:
if: #@ ignoreSkippedJobsCondition
name: Test
needs:
- build-packages
uses: "./.github/workflows/test-woven-classes.yml"
with:
version: ${{ needs.build-packages.outputs.package_version }}
#@ end

#@ def runSourceGenerationTests():
test-source-generation:
if: #@ ignoreSkippedJobsCondition
name: Test
uses: "./.github/workflows/test-source-generation.yml"
#@ end

#@ def buildUnity():
build-unity:
uses: ./.github/workflows/build-unity.yml
Expand Down
2 changes: 1 addition & 1 deletion .github/templates/common.lib.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#@ load("@ytt:template", "template")

#@ configuration = "Release"
#@ nugetPackages = [ 'Realm.Fody', 'Realm', 'Realm.UnityUtils', 'Realm.UnityWeaver' ]
#@ nugetPackages = [ 'Realm.Fody', 'Realm', 'Realm.UnityUtils', 'Realm.UnityWeaver', 'Realm.SourceGenerator' ]
#@ actionCheckout = "actions/checkout@v3"
#@ actionCache = "nirinchev/cache@29e8e4dd9148ea81f9e188480132072cb6cc92d8"
#@ actionUploadArtifact = "actions/upload-artifact@v3"
Expand Down
4 changes: 3 additions & 1 deletion .github/templates/pr.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#@ load("@ytt:template", "template")
#@ load("build.lib.yml", "deployBaas", "cleanupBaas", "runTests", "runNetCoreTests", "buildUnity", "testUnity")
#@ load("build.lib.yml", "deployBaas", "cleanupBaas", "runTests", "runNetCoreTests", "runWovenClassesTests", "runSourceGenerationTests", "buildUnity", "testUnity")
---
name: PR Build
"on":
Expand Down Expand Up @@ -40,6 +40,8 @@ jobs:
_: #@ template.replace(runTests("macOS", runSyncTests = False))
_: #@ template.replace(runTests("iOS", runSyncTests = False))
_: #@ template.replace(runTests("Android", runSyncTests = False, additionalSecrets=["AWS_DEVICEFARM_ACCESS_KEY_ID", "AWS_DEVICEFARM_SECRET_ACCESS_KEY", "DEVICEFARM_PROJECT_ARN", "DEVICEFARM_ANDROID_POOL_ARN"]))
_: #@ template.replace(runWovenClassesTests())
_: #@ template.replace(runSourceGenerationTests())
test-weaver:
uses: ./.github/workflows/test-weaver.yml
name: Test
Expand Down
22 changes: 22 additions & 0 deletions .github/templates/test-source-generation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#@ load("@ytt:template", "template")
#@ load("common.lib.yml", "checkoutCode", "actionSetupDotnet", "dotnetPublish")
#@ load("test.lib.yml", "publishTestsResults")

---
name: test-source-generation
"on":
workflow_call:
jobs:
run-tests:
runs-on: windows-latest
name: Source Generation
timeout-minutes: 45
steps:
- #@ template.replace(checkoutCode())
- uses: #@ actionSetupDotnet
with:
dotnet-version: '6.0.x'
- #@ template.replace(dotnetPublish("Tests/SourceGenerators/Realm.SourceGenerator.Tests", "net6.0", "win-x64"))
- name: Run the tests
run: #@ "${{ steps.dotnet-publish.outputs.executable-path }}/Realm.SourceGenerator.Tests --result=TestResults.SourceGeneration.xml"
- #@ publishTestsResults("TestResults.SourceGeneration.xml", "Source Generation")
22 changes: 22 additions & 0 deletions .github/templates/test-woven-classes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#@ load("@ytt:template", "template")
#@ load("common.lib.yml", "checkoutCode", "actionSetupDotnet")
#@ load("test.lib.yml", "fetchPackageArtifacts", "baasTestArgs", "publishTestsResults", "testDefinition", "buildTests", "wovenClassesBuildTests")

---
name: test-woven-classes
_: #@ template.replace(testDefinition())
jobs:
run-tests:
runs-on: windows-latest
name: Woven classes
timeout-minutes: 45
steps:
- #@ template.replace(checkoutCode())
- uses: #@ actionSetupDotnet
with:
dotnet-version: '6.0.x'
- #@ template.replace(fetchPackageArtifacts())
- #@ template.replace(wovenClassesBuildTests("Tests/Realm.Tests", "net6.0", "win-x64"))
- name: Run the tests
run: #@ "${{ steps.dotnet-publish.outputs.executable-path }}/Realm.Tests --result=TestResults.WovenClasses.xml --labels=After" + baasTestArgs("weaved-classes")
- #@ publishTestsResults("TestResults.WovenClasses.xml", "Woven classes")
12 changes: 11 additions & 1 deletion .github/templates/test.lib.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#@ load("@ytt:template", "template")
#@ load("common.lib.yml", "actionDownloadArtifact", "msbuild", "dotnetPublish", "fetchWrapperBinaries", "checkoutCode")

#@ def fetchPackageArtifacts(versionExpression = "inputs.version", packages = [ "Realm", "Realm.Fody" ]):
#@ def fetchPackageArtifacts(versionExpression = "inputs.version", packages = [ "Realm", "Realm.Fody", "Realm.SourceGenerator" ]):
#@ for pkg in packages:
- name: #@ "Fetch " + pkg
uses: #@ actionDownloadArtifact
Expand Down Expand Up @@ -80,6 +80,16 @@ env:
#@ }
#@ return dotnetPublish(projectPath, framework, runtime, properties)
#@ end

#@ def wovenClassesBuildTests(projectPath, framework, runtime, version = "inputs.version"):
#@ properties = {
#@ "RestoreConfigFile": "Tests/Test.NuGet.Config",
#@ "UseRealmNupkgsWithVersion": "${{ " + version + " }}",
#@ "TestWeavedClasses": "true",
#@ "RealmTestsStandaloneExe": "true"
#@ }
#@ return dotnetPublish(projectPath, framework, runtime, properties)
#@ end
---
#@ def prepareTest(fetchWrappers = False, cleanupWorkspace = False):
- #@ template.replace(checkoutCode())
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/build-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,8 @@ jobs:
run: msbuild Realm/Realm.UnityUtils -t:Pack -p:Configuration=Release -restore -p:PackageOutputPath=${{ github.workspace }}/Realm/packages -p:VersionSuffix=${{ steps.set-version-suffix.outputs.build_suffix }}
- name: Build Realm/Realm.UnityWeaver
run: msbuild Realm/Realm.UnityWeaver -t:Pack -p:Configuration=Release -restore -p:PackageOutputPath=${{ github.workspace }}/Realm/packages -p:VersionSuffix=${{ steps.set-version-suffix.outputs.build_suffix }}
- name: Build Realm/Realm.SourceGenerator
run: msbuild Realm/Realm.SourceGenerator -t:Pack -p:Configuration=Release -restore -p:PackageOutputPath=${{ github.workspace }}/Realm/packages -p:VersionSuffix=${{ steps.set-version-suffix.outputs.build_suffix }}
- name: Read version
id: get-version
run: |
Expand Down Expand Up @@ -171,6 +173,13 @@ jobs:
path: ${{ github.workspace }}/Realm/packages/Realm.UnityWeaver.${{ steps.get-version.outputs.version }}.*nupkg
retention-days: ${{ github.event_name != 'pull_request' && 30 || 1 }}
if-no-files-found: error
- name: Store artifacts for Realm.SourceGenerator.${{ steps.get-version.outputs.version }}
uses: actions/upload-artifact@v3
with:
name: Realm.SourceGenerator.${{ steps.get-version.outputs.version }}
path: ${{ github.workspace }}/Realm/packages/Realm.SourceGenerator.${{ steps.get-version.outputs.version }}.*nupkg
retention-days: ${{ github.event_name != 'pull_request' && 30 || 1 }}
if-no-files-found: error
- name: Store artifacts for ExtractedChangelog
uses: actions/upload-artifact@v3
with:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/build-unity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ jobs:
with:
name: Realm.UnityWeaver.${{ inputs.version }}
path: ${{ github.workspace }}/Realm/packages/
- name: Fetch Realm.SourceGenerator
uses: actions/download-artifact@v3
with:
name: Realm.SourceGenerator.${{ inputs.version }}
path: ${{ github.workspace }}/Realm/packages/
- name: Build Unity
run: dotnet run --project Tools/SetupUnityPackage/ -- realm --packages-path Realm/packages --pack
- name: Store artifacts for io.realm.unity-${{ inputs.version }}.tgz
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,7 @@ jobs:
run: msbuild Realm/Realm.UnityUtils -p:UseSharedCompilation=false -restore -p:Configuration=Release
- name: Build Realm.UnityWeaver
run: msbuild Realm/Realm.UnityWeaver -p:UseSharedCompilation=false -restore -p:Configuration=Release
- name: Build Realm.SourceGenerator
run: msbuild Realm/Realm.SourceGenerator -p:UseSharedCompilation=false -restore -p:Configuration=Release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@40542d38bc4936c2ca7da883aeb050a6081b4b31
12 changes: 12 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,18 @@ jobs:
AWS_DEVICEFARM_SECRET_ACCESS_KEY: ${{ secrets.AWS_DEVICEFARM_SECRET_ACCESS_KEY }}
DEVICEFARM_PROJECT_ARN: ${{ secrets.DEVICEFARM_PROJECT_ARN }}
DEVICEFARM_ANDROID_POOL_ARN: ${{ secrets.DEVICEFARM_ANDROID_POOL_ARN }}
test-weaved-classes:
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
name: Test
needs:
- build-packages
uses: ./.github/workflows/test-woven-classes.yml
with:
version: ${{ needs.build-packages.outputs.package_version }}
test-source-generation:
if: always() && !cancelled() && !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled')
name: Test
uses: ./.github/workflows/test-source-generation.yml
test-weaver:
uses: ./.github/workflows/test-weaver.yml
name: Test
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/test-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ jobs:
with:
name: Realm.Fody.${{ inputs.version }}
path: ${{ github.workspace }}/Realm/packages/
- name: Fetch Realm.SourceGenerator
uses: actions/download-artifact@v3
with:
name: Realm.SourceGenerator.${{ inputs.version }}
path: ${{ github.workspace }}/Realm/packages/
- uses: realm/ci-actions/mdb-realm/deploy@91ef434f7407cbdbd878f340b96f1dfb498e3010
if: ${{ inputs.realmUrl }}
with:
Expand Down Expand Up @@ -120,6 +125,11 @@ jobs:
with:
name: Realm.Fody.${{ inputs.version }}
path: ${{ github.workspace }}/Realm/packages/
- name: Fetch Realm.SourceGenerator
uses: actions/download-artifact@v3
with:
name: Realm.SourceGenerator.${{ inputs.version }}
path: ${{ github.workspace }}/Realm/packages/
- name: Configure .NET
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
with:
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/test-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ jobs:
with:
name: Realm.Fody.${{ inputs.version }}
path: ${{ github.workspace }}/Realm/packages/
- name: Fetch Realm.SourceGenerator
uses: actions/download-artifact@v3
with:
name: Realm.SourceGenerator.${{ inputs.version }}
path: ${{ github.workspace }}/Realm/packages/
- uses: realm/ci-actions/mdb-realm/deploy@91ef434f7407cbdbd878f340b96f1dfb498e3010
if: ${{ inputs.realmUrl }}
with:
Expand Down Expand Up @@ -104,6 +109,11 @@ jobs:
with:
name: Realm.Fody.${{ inputs.version }}
path: ${{ github.workspace }}/Realm/packages/
- name: Fetch Realm.SourceGenerator
uses: actions/download-artifact@v3
with:
name: Realm.SourceGenerator.${{ inputs.version }}
path: ${{ github.workspace }}/Realm/packages/
- name: Configure .NET
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
with:
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/test-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ jobs:
with:
name: Realm.Fody.${{ inputs.version }}
path: ${{ github.workspace }}/Realm/packages/
- name: Fetch Realm.SourceGenerator
uses: actions/download-artifact@v3
with:
name: Realm.SourceGenerator.${{ inputs.version }}
path: ${{ github.workspace }}/Realm/packages/
- uses: realm/ci-actions/mdb-realm/deploy@91ef434f7407cbdbd878f340b96f1dfb498e3010
if: ${{ inputs.realmUrl }}
with:
Expand Down Expand Up @@ -99,6 +104,11 @@ jobs:
with:
name: Realm.Fody.${{ inputs.version }}
path: ${{ github.workspace }}/Realm/packages/
- name: Fetch Realm.SourceGenerator
uses: actions/download-artifact@v3
with:
name: Realm.SourceGenerator.${{ inputs.version }}
path: ${{ github.workspace }}/Realm/packages/
- name: Configure .NET
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
with:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/test-net-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ jobs:
with:
name: Realm.Fody.${{ inputs.version }}
path: ${{ github.workspace }}/Realm/packages/
- name: Fetch Realm.SourceGenerator
uses: actions/download-artifact@v3
with:
name: Realm.SourceGenerator.${{ inputs.version }}
path: ${{ github.workspace }}/Realm/packages/
- uses: realm/ci-actions/mdb-realm/deploy@91ef434f7407cbdbd878f340b96f1dfb498e3010
if: ${{ inputs.realmUrl }}
with:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/test-net-framework.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ jobs:
with:
name: Realm.Fody.${{ inputs.version }}
path: ${{ github.workspace }}/Realm/packages/
- name: Fetch Realm.SourceGenerator
uses: actions/download-artifact@v3
with:
name: Realm.SourceGenerator.${{ inputs.version }}
path: ${{ github.workspace }}/Realm/packages/
- uses: realm/ci-actions/mdb-realm/deploy@91ef434f7407cbdbd878f340b96f1dfb498e3010
if: ${{ inputs.realmUrl }}
with:
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/test-source-generation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: test-source-generation
"on":
workflow_call: null
jobs:
run-tests:
runs-on: windows-latest
name: Source Generation
timeout-minutes: 45
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: false
ref: ${{ github.event.pull_request.head.sha }}
- name: Register csc problem matcher
run: echo "::add-matcher::.github/problem-matchers/csc.json"
- name: Register msvc problem matcher
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
- uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a
with:
dotnet-version: 6.0.x
- name: Publish Tests/SourceGenerators/Realm.SourceGenerator.Tests
run: dotnet publish Tests/SourceGenerators/Realm.SourceGenerator.Tests -c Release -f net6.0 -r win-x64 --no-self-contained
- name: Output executable path
id: dotnet-publish
run: echo '::set-output name=executable-path::./Tests/SourceGenerators/Realm.SourceGenerator.Tests/bin/Release/net6.0/win-x64'
- name: Run the tests
run: ${{ steps.dotnet-publish.outputs.executable-path }}/Realm.SourceGenerator.Tests --result=TestResults.SourceGeneration.xml
- name: Publish Unit Test Results
uses: LaPeste/test-reporter@b8a650f4490e7472b930f56bbb92c7b42dc5db15
if: always()
with:
name: Results Source Generation
path: TestResults.SourceGeneration.xml
reporter: java-junit
list-suites: failed
list-tests: failed
path-replace-backslashes: true
fail-on-error: false
5 changes: 5 additions & 0 deletions .github/workflows/test-uwp-managed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ jobs:
with:
name: Realm.Fody.${{ inputs.version }}
path: ${{ github.workspace }}/Realm/packages/
- name: Fetch Realm.SourceGenerator
uses: actions/download-artifact@v3
with:
name: Realm.SourceGenerator.${{ inputs.version }}
path: ${{ github.workspace }}/Realm/packages/
- uses: realm/ci-actions/mdb-realm/deploy@91ef434f7407cbdbd878f340b96f1dfb498e3010
if: ${{ inputs.realmUrl }}
with:
Expand Down
Loading