@@ -33,94 +33,89 @@ jobs:
3333 - name : Run linter
3434 run : make lint
3535
36- test :
37- name : Test
38- runs-on : ubuntu-latest
39- services :
40- neo4j :
41- image : neo4j:5-community
42- env :
43- NEO4J_AUTH : neo4j/password
44- NEO4J_PLUGINS : ' ["apoc","graph-data-science"]'
45- ports :
46- - 7474:7474
47- - 7687:7687
48- options : >-
49- --health-cmd "cypher-shell -u neo4j -p password 'RETURN 1'"
50- --health-interval 10s
51- --health-timeout 5s
52- --health-retries 10
53-
54- steps :
55- - uses : actions/checkout@v4
56-
57- - name : Set up Go
58- uses : actions/setup-go@v5
59- with :
60- go-version : ${{ env.GO_VERSION }}
61- cache : true
62-
63- - name : Install dependencies
64- run : make ci-deps
65-
66- - name : Run unit tests
67- run : make test
68- env :
69- NEO4J_URI : bolt://localhost:7687
70- NEO4J_USERNAME : neo4j
71- NEO4J_PASSWORD : password
72-
73- - name : Run integration tests
74- run : make test-integration
75- env :
76- NEO4J_URI : bolt://localhost:7687
77- NEO4J_USERNAME : neo4j
78- NEO4J_PASSWORD : password
79-
80- test-coverage :
81- name : Test Coverage
82- runs-on : ubuntu-latest
83- services :
84- neo4j :
85- image : neo4j:5-community
86- env :
87- NEO4J_AUTH : neo4j/password
88- NEO4J_PLUGINS : ' ["apoc","graph-data-science"]'
89- ports :
90- - 7474:7474
91- - 7687:7687
92- options : >-
93- --health-cmd "cypher-shell -u neo4j -p password 'RETURN 1'"
94- --health-interval 10s
95- --health-timeout 5s
96- --health-retries 10
97-
98- steps :
99- - uses : actions/checkout@v4
100-
101- - name : Set up Go
102- uses : actions/setup-go@v5
103- with :
104- go-version : ${{ env.GO_VERSION }}
105- cache : true
106-
107- - name : Install dependencies
108- run : make ci-deps
109-
110- - name : Run tests with coverage
111- run : make test-coverage
112- env :
113- NEO4J_URI : bolt://localhost:7687
114- NEO4J_USERNAME : neo4j
115- NEO4J_PASSWORD : password
116-
117- - name : Upload coverage to Codecov
118- uses : codecov/codecov-action@v4
119- with :
120- file : ./coverage.out
121- flags : unittests
122- name : codecov-umbrella
123- token : ${{ secrets.CODECOV_TOKEN }}
36+ # test:
37+ # name: Test
38+ # runs-on: ubuntu-latest
39+ # services:
40+ # neo4j:
41+ # image: neo4j:5-community
42+ # env:
43+ # NEO4J_AUTH: neo4j/password
44+ # NEO4J_PLUGINS: '["apoc","graph-data-science"]'
45+ # ports:
46+ # - 7474:7474
47+ # - 7687:7687
48+ # options: >-
49+ # --health-cmd "cypher-shell -u neo4j -p password 'RETURN 1'"
50+ # --health-interval 10s
51+ # --health-timeout 5s
52+ # --health-retries 10
53+
54+ # steps:
55+ # - uses: actions/checkout@v4
56+
57+ # - name: Set up Go
58+ # uses: actions/setup-go@v5
59+ # with:
60+ # go-version: ${{ env.GO_VERSION }}
61+ # cache: true
62+
63+ # - name: Install dependencies
64+ # run: make ci-deps
65+
66+ # - name: Run tests
67+ # run: make ci-test
68+ # env:
69+ # CI: true
70+ # NEO4J_TEST_URI: bolt://localhost:7687
71+ # NEO4J_TEST_USERNAME: neo4j
72+ # NEO4J_TEST_PASSWORD: password
73+
74+ # test-coverage:
75+ # name: Test Coverage
76+ # runs-on: ubuntu-latest
77+ # services:
78+ # neo4j:
79+ # image: neo4j:5-community
80+ # env:
81+ # NEO4J_AUTH: neo4j/password
82+ # NEO4J_PLUGINS: '["apoc","graph-data-science"]'
83+ # ports:
84+ # - 7474:7474
85+ # - 7687:7687
86+ # options: >-
87+ # --health-cmd "cypher-shell -u neo4j -p password 'RETURN 1'"
88+ # --health-interval 10s
89+ # --health-timeout 5s
90+ # --health-retries 10
91+
92+ # steps:
93+ # - uses: actions/checkout@v4
94+
95+ # - name: Set up Go
96+ # uses: actions/setup-go@v5
97+ # with:
98+ # go-version: ${{ env.GO_VERSION }}
99+ # cache: true
100+
101+ # - name: Install dependencies
102+ # run: make ci-deps
103+
104+ # - name: Run tests with coverage
105+ # run: make test-coverage
106+ # env:
107+ # CI: true
108+ # NEO4J_TEST_URI: bolt://localhost:7687
109+ # NEO4J_TEST_USERNAME: neo4j
110+ # NEO4J_TEST_PASSWORD: password
111+
112+ # - name: Upload coverage to Codecov
113+ # uses: codecov/codecov-action@v4
114+ # with:
115+ # file: ./coverage.out
116+ # flags: unittests
117+ # name: codecov-umbrella
118+ # token: ${{ secrets.CODECOV_TOKEN }}
124119
125120 security :
126121 name : Security Scan
@@ -171,26 +166,37 @@ jobs:
171166 runs-on : ubuntu-latest
172167 needs : [lint, test]
173168 if : github.event_name == 'push' && github.ref == 'refs/heads/main'
169+ permissions :
170+ contents : read
171+ packages : write
174172 steps :
175173 - uses : actions/checkout@v4
176174
177175 - name : Set up Docker Buildx
178176 uses : docker/setup-buildx-action@v3
179177
180- - name : Login to Docker Hub
178+ - name : Login to GitHub Container Registry
181179 uses : docker/login-action@v3
182180 with :
183- username : ${{ secrets.DOCKER_USERNAME }}
184- password : ${{ secrets.DOCKER_PASSWORD }}
185- if : github.event_name == 'push'
181+ registry : ghcr.io
182+ username : ${{ github.actor }}
183+ password : ${{ secrets.GITHUB_TOKEN }}
184+
185+ - name : Extract metadata
186+ id : meta
187+ uses : docker/metadata-action@v5
188+ with :
189+ images : ghcr.io/${{ github.repository }}
190+ tags : |
191+ type=ref,event=branch
192+ type=sha,prefix={{branch}}-
186193
187194 - name : Build and push Docker image
188195 uses : docker/build-push-action@v5
189196 with :
190197 context : .
191- push : ${{ github.event_name == 'push' }}
192- tags : |
193- ${{ secrets.DOCKER_USERNAME }}/gograph:latest
194- ${{ secrets.DOCKER_USERNAME }}/gograph:${{ github.sha }}
198+ push : true
199+ tags : ${{ steps.meta.outputs.tags }}
200+ labels : ${{ steps.meta.outputs.labels }}
195201 cache-from : type=gha
196202 cache-to : type=gha,mode=max
0 commit comments