Skip to content

Commit 47ec4d5

Browse files
authored
Develop (#37)
* Update CI scripts * Licensing * Add Data submodule * Library upgrade * improved parsing API * introduce FLAT2 support * improved formatting API including CKSUM synthesis * introduce CommonViewPeriod * introduce CommonViewCalendar * refactoring sky tracker --------- Signed-off-by: Guillaume W. Bres <[email protected]>
1 parent f060123 commit 47ec4d5

Some content is hidden

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

66 files changed

+4229
-8486
lines changed

.github/workflows/daily.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Daily
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
tags:
7+
- "*"
8+
pull_request:
9+
branches: [ main ]
10+
11+
env:
12+
CARGO_TERM_COLOR: always
13+
14+
jobs:
15+
build:
16+
name: Build
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v3
20+
with:
21+
submodules: recursive
22+
fetch-depth: 0
23+
24+
- uses: actions-rs/toolchain@v1
25+
name: Install Rust
26+
with:
27+
toolchain: stable
28+
override: true
29+
30+
- uses: actions-rs/cargo@v1
31+
name: Build
32+
with:
33+
command: build
34+
args: --all-features
35+
36+
- uses: actions-rs/cargo@v1
37+
name: Test
38+
with:
39+
command: test
40+
args: --all-features

.github/workflows/release.yml

Lines changed: 38 additions & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -9,106 +9,65 @@ permissions:
99
contents: write
1010

1111
jobs:
12-
build:
13-
name: build
14-
runs-on: ${{ matrix.os }}
15-
env:
16-
CARGO: cargo
17-
# Emit backtraces on panics.
18-
RUST_BACKTRACE: 1
19-
strategy:
20-
fail-fast: false
21-
matrix:
22-
include:
23-
- build: linux
24-
os: ubuntu-latest
25-
rust: stable
26-
target: x86_64-unknown-linux-gnu
27-
- build: macos
28-
os: macos-latest
29-
rust: stable
30-
target: x86_64-apple-darwin
31-
- build: macos
32-
os: macos-latest
33-
rust: stable
34-
target: aarch64-apple-darwin
35-
- build: win64-msvc
36-
os: windows-latest
37-
rust: stable-x86_64-gnu
38-
target: x86_64-pc-windows-msvc
39-
- build: win64-gnu
40-
os: windows-latest
41-
rust: stable
42-
target: x86_64-pc-windows-gnu
43-
12+
publish_crates:
13+
name: Release
14+
runs-on: ubuntu-latest
15+
continue-on-error: true
16+
if: github.ref_type == 'tag'
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
- name: Install stable
21+
uses: actions-rs/toolchain@v1
22+
with:
23+
toolchain: stable
24+
- name: Publish
25+
env:
26+
TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
27+
run: |
28+
cargo login $TOKEN
29+
cargo publish --allow-dirty
30+
31+
archive:
32+
name: Archive
33+
runs-on: ubuntu-latest
34+
continue-on-error: true
4435
steps:
4536
- name: Checkout repository
4637
uses: actions/checkout@v4
4738

48-
- name: Install Rust
49-
uses: actions-rs/toolchain@v1
50-
with:
51-
toolchain: ${{ matrix.rust }}
52-
target: ${{ matrix.target }}
53-
54-
- name: Build applications
55-
shell: bash
56-
run: |
57-
CARGO_PROFILE_RELEASE_STRIP=symbols ${{ env.CARGO }} build \
58-
--verbose \
59-
--target ${{ matrix.target }} \
60-
--all-features \
61-
--release \
62-
-p cggtts-cli
63-
ls -lah target/${{ matrix.target }}/release
64-
if [ "${{ matrix.os }}" = "windows-latest" ]; then
65-
bin="target/${{ matrix.target }}/release/cggtts-cli.exe"
66-
else
67-
bin="target/${{ matrix.target }}/release/cggtts-cli"
68-
fi
69-
echo "BIN=$bin" >> $GITHUB_ENV
70-
7139
- name: Determine archive name
7240
shell: bash
7341
run: |
74-
echo "ARCHIVE=cggtts-cli-${{ github.ref_name }}-${{ matrix.target }}" >> $GITHUB_ENV
42+
echo "ARCHIVE=cggtts-${{ github.ref_name }}" >> $GITHUB_ENV
7543
7644
- name: Creating directory for archive
7745
shell: bash
7846
run: |
7947
mkdir -p "$ARCHIVE"
80-
cp "$BIN" "$ARCHIVE"/
81-
cp {README.md,LICENSE-MIT,LICENSE-APACHE} "$ARCHIVE"/
48+
cp {README.md,LICENSE} "$ARCHIVE"
8249
8350
- name: Gzip archive (Unix)
8451
shell: bash
85-
if: matrix.os != 'windows-latest'
8652
run: |
8753
tar czf "$ARCHIVE.tar.gz" "$ARCHIVE"
8854
shasum -a 256 "$ARCHIVE.tar.gz" > "$ARCHIVE.tar.gz.sha256"
8955
echo "ASSET=$ARCHIVE.tar.gz" >> $GITHUB_ENV
9056
echo "ASSET_SUM=$ARCHIVE.tar.gz.sha256" >> $GITHUB_ENV
9157
92-
- name: Zip archive (Windows)
93-
shell: bash
94-
if: matrix.os == 'windows-latest'
95-
run: |
96-
7z a "$ARCHIVE.zip" "$ARCHIVE"
97-
certutil -hashfile "$ARCHIVE.zip" SHA256 > "$ARCHIVE.zip.sha256"
98-
echo "ASSET=$ARCHIVE.zip" >> $GITHUB_ENV
99-
echo "ASSET_SUM=$ARCHIVE.zip.sha256" >> $GITHUB_ENV
100-
101-
- name: Upload artifact
102-
uses: actions/upload-artifact@v3
58+
- name: Upload artifacts
59+
uses: actions/upload-artifact@v4
10360
with:
10461
name: ${{ env.ASSET }}
10562
path: |
10663
${{ env.ASSET }}
107-
${{ env.ASSET_SUM }}
108-
64+
10965
release:
11066
runs-on: ubuntu-latest
111-
needs: ['build']
67+
needs: ['archive']
68+
# continue even though we failed to download or upload one
69+
# or more artefacts
70+
continue-on-error: true
11271
steps:
11372
- name: Create Release
11473
id: create_release
@@ -120,77 +79,17 @@ jobs:
12079
tag_name: ${{ github.ref_name }}
12180
release_name: ${{ github.ref_name }}
12281

123-
- name: Download linux-stable
124-
uses: actions/download-artifact@v3
125-
with:
126-
name: cggtts-cli-${{ github.ref_name }}-x86_64-unknown-linux-gnu.tar.gz
127-
128-
- name: Upload linux-stable
129-
uses: actions/upload-release-asset@v1
130-
env:
131-
GITHUB_TOKEN: ${{ github.token }}
132-
with:
133-
upload_url: ${{ steps.create_release.outputs.upload_url }}
134-
asset_path: cggtts-cli-${{ github.ref_name }}-x86_64-unknown-linux-gnu.tar.gz
135-
asset_name: cggtts-cli-x86_x64-linux-gnu.tar.gz
136-
asset_content_type: application/gzip
137-
138-
- name: Download macos-latest
139-
uses: actions/download-artifact@v3
82+
- name: Download Artifact
83+
uses: actions/download-artifact@v4
14084
with:
141-
name: cggtts-cli-${{ github.ref_name }}-x86_64-apple-darwin.tar.gz
142-
143-
- name: Upload macos-latest
144-
uses: actions/upload-release-asset@v1
145-
env:
146-
GITHUB_TOKEN: ${{ github.token }}
147-
with:
148-
upload_url: ${{ steps.create_release.outputs.upload_url }}
149-
asset_path: cggtts-cli-${{ github.ref_name }}-x86_64-apple-darwin.tar.gz
150-
asset_name: cggtts-cli-x86_64-apple-darwin.tar.gz
151-
asset_content_type: application/gzip
85+
name: cggtts-${{ github.ref_name }}
15286

153-
- name: Download macos-latest (aarch64)
154-
uses: actions/download-artifact@v3
155-
with:
156-
name: cggtts-cli-${{ github.ref_name }}-aarch64-apple-darwin.tar.gz
157-
158-
- name: Upload macos-latest
87+
- name: Upload asset
15988
uses: actions/upload-release-asset@v1
16089
env:
16190
GITHUB_TOKEN: ${{ github.token }}
16291
with:
16392
upload_url: ${{ steps.create_release.outputs.upload_url }}
164-
asset_path: cggtts-cli-${{ github.ref_name }}-aarch64-apple-darwin.tar.gz
165-
asset_name: cggtts-cli-aarch64-apple-darwin.tar.gz
93+
asset_path: cggtts-${{ github.ref_name }}
94+
asset_name: cggtts-${{ github.ref_name }}
16695
asset_content_type: application/gzip
167-
168-
- name: Download windows x86_64 (msvc)
169-
uses: actions/download-artifact@v3
170-
with:
171-
name: cggtts-cli-${{ github.ref_name }}-x86_64-pc-windows-msvc.zip
172-
173-
- name: Download windows x86_64 (msvc)
174-
uses: actions/upload-release-asset@v1
175-
env:
176-
GITHUB_TOKEN: ${{ github.token }}
177-
with:
178-
upload_url: ${{ steps.create_release.outputs.upload_url }}
179-
asset_path: cggtts-cli-${{ github.ref_name }}-x86_64-pc-windows-msvc.zip
180-
asset_name: cggtts-cli-x86_64-pc-windows-msvc.zip
181-
asset_content_type: application/zip
182-
183-
- name: Download windows x86_64 (gnu)
184-
uses: actions/download-artifact@v3
185-
with:
186-
name: cggtts-cli-${{ github.ref_name }}-x86_64-pc-windows-gnu.zip
187-
188-
- name: Download windows x86_64 (msvc)
189-
uses: actions/upload-release-asset@v1
190-
env:
191-
GITHUB_TOKEN: ${{ github.token }}
192-
with:
193-
upload_url: ${{ steps.create_release.outputs.upload_url }}
194-
asset_path: cggtts-cli-${{ github.ref_name }}-x86_64-pc-windows-gnu.zip
195-
asset_name: cggtts-cli-x86_64-pc-windows-gnu.zip
196-
asset_content_type: application/zip

.github/workflows/rust.yml

Lines changed: 20 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Rust
1+
name: CI
22

33
on:
44
push:
@@ -12,80 +12,47 @@ env:
1212
CARGO_TERM_COLOR: always
1313

1414
jobs:
15-
lint:
16-
name: Linter
15+
build:
16+
name: Build
1717
runs-on: ubuntu-latest
1818
steps:
1919
- uses: actions/checkout@v3
20+
with:
21+
submodules: recursive
22+
fetch-depth: 0
23+
2024
- uses: actions-rs/toolchain@v1
2125
name: Install Rust
2226
with:
2327
toolchain: stable
2428
override: true
2529
components: rustfmt, clippy
30+
2631
- uses: actions-rs/cargo@v1
2732
name: Linter
2833
with:
2934
command: fmt
3035
args: --all -- --check
31-
- name: Audit
32-
continue-on-error: true
33-
run: |
34-
cargo install cargo-audit
35-
cargo audit
36-
37-
tests:
38-
name: Tests
39-
runs-on: ubuntu-latest
40-
steps:
41-
- uses: actions/checkout@v3
42-
- uses: actions-rs/toolchain@v1
43-
name: Install Rust
36+
37+
- uses: actions-rs/cargo@v1
38+
name: Build
4439
with:
45-
toolchain: stable
46-
override: true
40+
command: build
41+
4742
- uses: actions-rs/cargo@v1
4843
name: Test
4944
with:
5045
command: test
5146
args: --verbose
47+
48+
- uses: actions-rs/cargo@v1
49+
name: Build (all features)
50+
with:
51+
command: build
52+
args: --all-features
53+
5254
- uses: actions-rs/cargo@v1
5355
name: Test (all features)
5456
with:
5557
command: test
5658
args: --verbose --all-features
57-
58-
build-ws:
59-
name: Build Windows
60-
runs-on: windows-latest
61-
steps:
62-
- uses: actions/checkout@v2
63-
- name: Build
64-
run: cargo build --all-features --release --verbose
65-
66-
build-mac:
67-
name: Build Mac-OS
68-
runs-on: macos-latest
69-
steps:
70-
- uses: actions/checkout@v2
71-
- name: Build
72-
run: cargo build --all-features --release --verbose
73-
74-
publish:
75-
name: Publish Library
76-
runs-on: ubuntu-latest
77-
needs: [lint, tests, build-ws, build-mac]
78-
if: github.ref_type == 'tag'
79-
steps:
80-
- name: Checkout
81-
uses: actions/checkout@v4
82-
- name: Install stable toolchain
83-
uses: dtolnay/rust-toolchain@master
84-
with:
85-
toolchain: stable
86-
- name: Publish
87-
env:
88-
TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
89-
run: |
90-
cargo login $TOKEN
91-
cargo publish -p cggtts

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
target/
2-
data/
32
Cargo.lock
43
*.swo
54
*.swp
6-
cggtts/test.txt
75
*.html
6+
test.txt

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "data"]
2+
path = data
3+
url = https://github.com/rtk-rs/data

0 commit comments

Comments
 (0)