Skip to content

Commit d0fc382

Browse files
authored
add github actions (#2)
* add github actions * readme updates * documenting some details
1 parent 4ce0366 commit d0fc382

File tree

6 files changed

+117
-4
lines changed

6 files changed

+117
-4
lines changed

.github/workflows/build-full.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
on:
2+
push:
3+
tags:
4+
- 'v*' # Triggers on version tags
5+
6+
jobs:
7+
tests:
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
matrix:
11+
nimversion:
12+
- '2.x'
13+
os:
14+
- ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: iffy/install-nim@v4
19+
with:
20+
version: ${{ matrix.nimversion }}
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
24+
- name: Get tag version
25+
id: get_version
26+
run: |
27+
git config --global user.email "atlas-tests-bot@nim-lang.org"
28+
git config --global user.name "Atlas Tests Bot"
29+
# Strip the 'v' prefix from the tag
30+
VERSION=${GITHUB_REF#refs/tags/v}
31+
echo "version=$VERSION" >> $GITHUB_OUTPUT
32+
33+
- name: Build Tests
34+
run: |
35+
nim atlasTestsCreate
36+
37+
- name: Create Release
38+
uses: softprops/action-gh-release@v1
39+
with:
40+
name: Release ${{ steps.get_version.outputs.version }}
41+
tag_name: v${{ steps.get_version.outputs.version }}
42+
draft: false
43+
prerelease: false
44+
generate_release_notes: true
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/build-release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
on:
3+
push:
4+
branches:
5+
- "main"
6+
pull_request:
7+
branches:
8+
- "*"
9+
10+
jobs:
11+
tests:
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
nimversion:
16+
- '2.x'
17+
os:
18+
- ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- uses: iffy/install-nim@v4
23+
with:
24+
version: ${{ matrix.nimversion }}
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
28+
- name: Get version
29+
id: get_version
30+
run: |
31+
git config --global user.email "atlas-tests-bot@nim-lang.org"
32+
git config --global user.name "Atlas Tests Bot"
33+
VERSION=$(nim --verbosity:0 atlasTestsVersion)
34+
echo "version=$VERSION" >> $GITHUB_OUTPUT
35+
36+
- name: Build Tests
37+
run: |
38+
nim --verbosity:0 atlasTestsVersion
39+
nim atlasTestsCreate
40+
41+
- uses: actions/upload-artifact@v4
42+
with:
43+
name: atlas-tests
44+
path: atlas-tests.zip

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,18 @@
11
# atlas-tests
22
Persistent Atlas tests.
3+
4+
To generate an update atlas-tests.zip run:
5+
6+
nim atlasTestsCreate
7+
8+
This will create a couple of folders needed for testing Atlas's workspaces:
9+
10+
atlas-tests/ws_generate/buildGraph
11+
atlas-tests/ws_generate/buildGraphNoGitTags
12+
atlas-tests/ws_generate/manifest.txt
13+
atlas-tests/ws_generate/<org>/<repo>...
14+
atlas-tests/ws_generate/readme.md
15+
atlas-tests/ws_ingtegration/manifest.txt
16+
atlas-tests/ws_ingtegration/<org>/<repo>...
17+
18+
The file `atlas-tests/ws_generate/readme.md` should not be modified as it's contents are used as a sanity check in Atlas `tester.nim`.

config.nims

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@ task atlasTestsCreate, "Create a atlas-tests zipped cache":
1212
task atlasTestsSetup, "Setup atlas-tests from a cached zip":
1313
exec "nim c -r downloadTestRepos"
1414

15+
task clean, "Clean all":
16+
rmDir("atlas-tests/ws_generated")
17+
rmDir("atlas-tests/ws_integration")
18+
1519
task cleanDist, "Clean all":
16-
rmDir("atlas-tests")
20+
rmDir("atlas-tests/working")
21+
rmDir("atlas-tests/working")
1722
mkDir("atlas-tests")
1823
writeFile("atlas-tests/.gitkeep", "")
1924
for item in walkDir("."):

createTestReposZip.nim

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ import downloadTestRepos
77
runWsGenerated()
88
runWsIntegration()
99

10-
withDir "atlas-tests":
11-
let zipfile = "atlas-tests.zip"
12-
exec "zip -ru $1 ws_generated/ ws_integration/" % [zipfile]
10+
let zipfile = "atlas-tests.zip"
11+
exec "zip -ru $1 atlas-tests/ws_generated/ atlas-tests/ws_integration/" % [zipfile]

wsIntegration.nim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ proc runWsIntegration*() =
3838
repos.add(repo)
3939

4040
proc getRepoUrls(): seq[string] =
41+
## these were gathered after running `--full --keepWorkspace use https://github.com/zedeus/nitter`
42+
## the urls should be cleaned up, e.g. remove `.git` at the ends
43+
## the `githttpserver` will handle routing `.git` urls during the test runs
4144
let repos = dedent"""
4245
https://github.com/timotheecour/asynctools
4346
https://github.com/disruptek/bump

0 commit comments

Comments
 (0)