66 pull_request :
77 branches : [ 'master' ]
88
9+ env :
10+ go_version : 1.18
11+ node_version : 14
12+
13+ DATABASE_USER : root
14+ DATABASE_PASSWORD : example
15+ DATABASE_HOST : 127.0.0.1
16+
917jobs :
18+ openapi-code-generator :
19+ runs-on : ubuntu-latest
20+ steps :
21+ - uses : actions/checkout@v3
22+ with :
23+ fetch-depth : 1
24+ - run : make openapi-spec
25+
26+ - uses : actions/upload-artifact@v3
27+ with :
28+ name : openapi-files
29+ path : |
30+ assets/openapi
31+ pkg/openapi
32+ if-no-files-found : error
33+
1034 frontend :
35+ needs : openapi-code-generator
1136 runs-on : ubuntu-latest
1237 steps :
1338 - uses : actions/checkout@v3
1439 with :
1540 fetch-depth : 1
1641 - uses : actions/setup-node@v3
1742 with :
18- node-version : ' 16'
43+ node-version : ${{ env.node_version }}
44+ - uses : actions/download-artifact@v3
45+ with :
46+ name : openapi-files
47+ path : .
48+
1949 - run : make lint-frontend
2050 - run : make frontend
2151
52+ - run : make test-frontend
53+
2254 backend :
55+ needs : openapi-code-generator
2356 runs-on : ubuntu-latest
2457 strategy :
2558 fail-fast : false
2659 matrix :
2760 mongodb_image : ['mongo:4', 'mongo:5']
2861
29- env :
30- DATABASE_USER : root
31- DATABASE_PASSWORD : example
32- DATABASE_HOST : 127.0.0.1
33-
3462 services :
3563 mongodb :
3664 env :
@@ -44,10 +72,16 @@ jobs:
4472 - uses : actions/checkout@v3
4573 with :
4674 fetch-depth : 1
75+
76+ - uses : actions/download-artifact@v3
77+ with :
78+ name : openapi-files
79+ path : .
80+
4781 - name : Set up Go
4882 uses : actions/setup-go@v3
4983 with :
50- go-version : 1.17
84+ go-version : ${{ env.go_version }}
5185
5286 - name : Test
5387 run : make test
5791
5892 - name : Print coverage
5993 run : go tool cover -func cover.out | tail -n 1 | awk '{print $3}'
94+
95+ e2e :
96+ needs : [backend, frontend]
97+ runs-on : ubuntu-latest
98+
99+ strategy :
100+ fail-fast : false
101+ matrix :
102+ mongodb_image : [ 'mongo:4', 'mongo:5' ]
103+
104+ services :
105+ mongodb :
106+ env :
107+ MONGO_INITDB_ROOT_USERNAME : root
108+ MONGO_INITDB_ROOT_PASSWORD : example
109+ image : ${{ matrix.mongodb_image }}
110+ ports :
111+ - 27017:27017
112+
113+ steps :
114+ - uses : actions/checkout@v3
115+ with :
116+ fetch-depth : 1
117+
118+ - uses : actions/download-artifact@v3
119+ with :
120+ name : openapi-files
121+ path : .
122+
123+ - uses : actions/setup-node@v3
124+ with :
125+ node-version : ${{ env.node_version }}
126+
127+ - name : Set up Go
128+ uses : actions/setup-go@v3
129+ with :
130+ go-version : ${{ env.go_version }}
131+
132+ - name : Run e2e suite
133+ env :
134+ SPOTIFY_ID : ${{ secrets.SPOTIFY_ID }}
135+ SPOTIFY_SECRET : ${{ secrets.SPOTIFY_SECRET }}
136+ GENIUS_API_TOKEN : ${{ secrets.GENIUS_API_TOKEN }}
137+ run : make test-e2e
138+
139+ - uses : actions/upload-artifact@v3
140+ if : failure()
141+ with :
142+ name : cypress-files
143+ path : |
144+ tests/e2e/screenshots
145+ tests/e2e/videos
0 commit comments