Skip to content

Commit d568231

Browse files
authored
Revert "Fix ci and benchmarks (#581)" (#584)
This reverts commit 6c6c640.
1 parent d64eaab commit d568231

File tree

308 files changed

+332
-587
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

308 files changed

+332
-587
lines changed

.github/actions/go-check-setup/action.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@ runs:
99
path: |
1010
~/.cache/go-build
1111
~/go/pkg/mod
12-
key: ${{ matrix.os }}-golang-${{ matrix.go }}-${{ hashFiles('**/go.sum') }}-${{ github.ref }}-${{ github.sha }}
12+
key: ${{ matrix.os }}-golang-${{ matrix.go }}-${{ hashFiles('**/go.sum') }}
1313
restore-keys: |
14-
${{ matrix.os }}-golang-${{ matrix.go }}-${{ hashFiles('**/go.sum') }}-${{ github.ref }}-
15-
${{ matrix.os }}-golang-${{ matrix.go }}-${{ hashFiles('**/go.sum') }}-
1614
${{ matrix.os }}-golang-${{ matrix.go }}-
1715
1816
- name: Setup Go

.github/actions/go-test-setup/action.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,14 @@ description: Setup Cache
33
runs:
44
using: "composite"
55
steps:
6-
- name: Clean Go cache directories
7-
shell: bash
8-
run: |
9-
rm -rf ~/.cache/go-build
10-
rm -rf ~/go/pkg/mod
116
- name: Setup Golang caches
127
uses: actions/cache@v4
138
with:
149
path: |
1510
~/.cache/go-build
1611
~/go/pkg/mod
17-
key: ${{ matrix.os }}-golang-${{ matrix.go }}-${{ hashFiles('**/go.sum') }}-${{ github.ref }}-${{ github.sha }}
12+
key: ${{ matrix.os }}-golang-${{ matrix.go }}-${{ hashFiles('**/go.sum') }}
1813
restore-keys: |
19-
${{ matrix.os }}-golang-${{ matrix.go }}-${{ hashFiles('**/go.sum') }}-${{ github.ref }}-
20-
${{ matrix.os }}-golang-${{ matrix.go }}-${{ hashFiles('**/go.sum') }}-
2114
${{ matrix.os }}-golang-${{ matrix.go }}-
2215
- name: Setup PostgreSQL database
2316
uses: ikalnytskyi/action-setup-postgres@v6

.github/workflows/cache-cleanup.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/docgen.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/go-check.yml

Lines changed: 6 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ name: Go Checks
22

33
on:
44
pull_request:
5-
branches: [main, develop]
65
push:
7-
branches: [main, develop]
6+
branches: ["main"]
87
workflow_dispatch:
98

109
permissions:
@@ -15,88 +14,19 @@ concurrency:
1514
cancel-in-progress: true
1615

1716
jobs:
18-
go-check-all:
19-
name: go-check / All
20-
runs-on: ubuntu-latest
21-
services:
22-
mysql:
23-
image: mysql:8.0
24-
env:
25-
MYSQL_ROOT_PASSWORD: root
26-
MYSQL_DATABASE: singularity
27-
MYSQL_USER: singularity
28-
MYSQL_PASSWORD: singularity
29-
ports:
30-
- 3306:3306
31-
options: >-
32-
--health-cmd="mysqladmin ping"
33-
--health-interval=10s
34-
--health-timeout=5s
35-
--health-retries=3
36-
37-
postgres:
38-
image: postgres:15
39-
env:
40-
POSTGRES_USER: singularity
41-
POSTGRES_PASSWORD: singularity
42-
POSTGRES_DB: singularity
43-
ports:
44-
- 5432:5432
45-
options: >-
46-
--health-cmd pg_isready
47-
--health-interval 10s
48-
--health-timeout 5s
49-
--health-retries 5
50-
51-
steps:
52-
- uses: actions/checkout@v3
53-
54-
- name: Set up Go
55-
uses: actions/setup-go@v4
56-
with:
57-
go-version: "1.21.x"
58-
59-
- name: Wait for PostgreSQL
60-
run: |
61-
echo "Waiting for PostgreSQL..."
62-
for i in {1..10}; do
63-
if PGPASSWORD=singularity psql -h localhost -U singularity -d singularity -c "SELECT 1" > /dev/null 2>&1; then
64-
echo "Postgres is ready!"
65-
break
66-
fi
67-
sleep 3
68-
done
69-
70-
- name: Verify MySQL connection
71-
run: mysql -h127.0.0.1 -P3306 -usingularity -psingularity -e "SELECT VERSION();"
72-
73-
- name: Verify PostgreSQL connection
74-
run: PGPASSWORD=singularity psql -h localhost -U singularity -d singularity -c "SELECT version();"
75-
76-
- name: Ensure swagger directories exist
77-
run: mkdir -p client/swagger/client
78-
79-
- name: Install swagger tools
80-
run: go install github.com/go-swagger/go-swagger/cmd/[email protected]
81-
82-
- name: Generate code
83-
run: go generate ./client/swagger/...
84-
85-
- name: Build
86-
run: go build ./...
87-
88-
- name: Run tests
89-
run: go test -v ./...
17+
go-check:
18+
uses: ipdxco/unified-github-workflows/.github/workflows/[email protected]
9019

9120
staticcheck:
9221
runs-on: ubuntu-latest
9322
steps:
94-
- uses: actions/checkout@v3
23+
- name: Checkout code
24+
uses: actions/checkout@v3
9525

9626
- name: Set up Go
9727
uses: actions/setup-go@v4
9828
with:
99-
go-version: "1.21.x"
29+
go-version: "1.21"
10030

10131
- name: Install staticcheck
10232
run: go install honnef.co/go/tools/cmd/staticcheck@latest

.github/workflows/go-test.yml

Lines changed: 3 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ name: Go Test
22

33
on:
44
pull_request:
5-
branches: [main, develop]
65
push:
7-
branches: [main, develop]
6+
branches: ["main"]
87
workflow_dispatch:
98

109
permissions:
@@ -15,50 +14,5 @@ concurrency:
1514
cancel-in-progress: true
1615

1716
jobs:
18-
go-test-this:
19-
name: go-test / ${{ matrix.os }} (go this)
20-
runs-on: ${{ matrix.os }}
21-
strategy:
22-
matrix:
23-
os: [ubuntu-latest, macos-latest, windows-latest]
24-
steps:
25-
- uses: actions/checkout@v3
26-
27-
- name: Start MongoDB
28-
if: runner.os == 'Linux'
29-
uses: supercharge/[email protected]
30-
with:
31-
mongodb-version: '6.0'
32-
mongodb-port: 27018
33-
34-
- name: Set up Go
35-
uses: actions/setup-go@v4
36-
with:
37-
go-version: '1.21'
38-
39-
- name: Run Go Tests
40-
run: go test ./...
41-
42-
go-test-next:
43-
name: go-test / ${{ matrix.os }} (go next)
44-
runs-on: ${{ matrix.os }}
45-
strategy:
46-
matrix:
47-
os: [ubuntu-latest, macos-latest, windows-latest]
48-
steps:
49-
- uses: actions/checkout@v3
50-
51-
- name: Start MongoDB
52-
if: runner.os == 'Linux'
53-
uses: supercharge/[email protected]
54-
with:
55-
mongodb-version: '6.0'
56-
mongodb-port: 27018
57-
58-
- name: Set up Go
59-
uses: actions/setup-go@v4
60-
with:
61-
go-version: '1.21'
62-
63-
- name: Run Go Tests
64-
run: go test ./...
17+
go-test:
18+
uses: ipdxco/unified-github-workflows/.github/workflows/[email protected]

README.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -427,16 +427,3 @@ The internal tool used by `js-singularity` to regenerate the CAR that captures t
427427

428428
## License
429429
Dual-licensed under [MIT](https://github.com/filecoin-project/lotus/blob/master/LICENSE-MIT) + [Apache 2.0](https://github.com/filecoin-project/lotus/blob/master/LICENSE-APACHE)
430-
431-
## Integration Tests & MongoDB
432-
433-
Some integration tests require a MongoDB instance running on `localhost:27018`.
434-
435-
- **CI:** MongoDB is automatically started on port 27018 in GitHub Actions workflows.
436-
- **Local Development:** You must start MongoDB locally on port 27018 before running tests:
437-
438-
```bash
439-
mongod --port 27018
440-
```
441-
442-
If MongoDB is not available, related tests will be skipped or fail with a connection error.

analytics/analytics.go

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@ import (
2121

2222
const flushInterval = time.Hour
2323

24-
var (
25-
mu sync.RWMutex
26-
Enabled = true
27-
)
24+
var Enabled = true
2825

2926
var logger = log.Logger("analytics")
3027

@@ -40,8 +37,6 @@ var logger = log.Logger("analytics")
4037
// Returns:
4138
// - An error if there are issues fetching the instance id from the database or if the database appears empty.
4239
func Init(ctx context.Context, db *gorm.DB) error {
43-
mu.Lock()
44-
defer mu.Unlock()
4540
if Instance != "" {
4641
return nil
4742
}
@@ -73,27 +68,6 @@ var (
7368
Identity string
7469
)
7570

76-
// GetInstance safely returns the Instance value
77-
func GetInstance() string {
78-
mu.RLock()
79-
defer mu.RUnlock()
80-
return Instance
81-
}
82-
83-
// GetIdentity safely returns the Identity value
84-
func GetIdentity() string {
85-
mu.RLock()
86-
defer mu.RUnlock()
87-
return Identity
88-
}
89-
90-
// IsEnabled safely returns the Enabled value
91-
func IsEnabled() bool {
92-
mu.RLock()
93-
defer mu.RUnlock()
94-
return Enabled
95-
}
96-
9771
type Collector struct {
9872
mu sync.Mutex
9973
packJobEvents []PackJobEvent

0 commit comments

Comments
 (0)