Skip to content

Commit 16d041d

Browse files
committed
ci: new workflow to archive conformance data
1 parent 66e550b commit 16d041d

File tree

1 file changed

+97
-0
lines changed

1 file changed

+97
-0
lines changed

.github/workflows/archive.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Archive Data
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: write
8+
id-token: write
9+
10+
concurrency:
11+
group: "archive"
12+
13+
jobs:
14+
check-tag:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Check tag
21+
run: |
22+
TAG="r$(date +%Y%m%d)"
23+
if git rev-parse "$TAG" >/dev/null 2>&1; then
24+
echo "Tag $TAG already exists."
25+
exit 1
26+
fi
27+
28+
archive:
29+
needs: check-tag
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
with:
35+
lfs: true
36+
ssh-key: ${{ secrets.COMMIT_KEY }}
37+
38+
- name: Install poetry
39+
run: pipx install poetry
40+
41+
- uses: actions/setup-python@v4
42+
with:
43+
python-version: "3.11"
44+
cache: "poetry"
45+
46+
- name: Install dependencies
47+
working-directory: ./src
48+
run: |
49+
poetry env use "3.11"
50+
poetry install --no-interaction
51+
52+
- name: Run construct
53+
working-directory: ./src
54+
run: poetry run construct-all
55+
56+
- name: Run coverage
57+
working-directory: ./src
58+
run: poetry run coverage
59+
60+
- name: Copy LFS files to public folder
61+
run: |
62+
files=$(git lfs ls-files --long | cut -d ' ' -f3)
63+
mkdir -p ${{ runner.temp }}/files
64+
for file in $files; do
65+
dir=$(dirname ${file#*/*/})
66+
mkdir -p ${{ runner.temp }}/files/$dir
67+
cp $file ${{ runner.temp }}/files/${file#*/*/}
68+
done
69+
70+
- name: Create archive
71+
working-directory: ${{ runner.temp }}
72+
run: |
73+
ARCHIVE_NAME="conformance-files.tar.gz"
74+
tar -czf $ARCHIVE_NAME files
75+
echo "Archive created: $ARCHIVE_NAME"
76+
77+
- name: Configure GitHub handle
78+
run: |
79+
git config --global user.name "github-actions[bot]"
80+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
81+
82+
- name: Create tag
83+
id: create-tag
84+
run: |
85+
TAG="r$(date +%Y%m%d)"
86+
git tag "$TAG"
87+
git push origin "$TAG"
88+
echo "TAG=$TAG" >> $GITHUB_OUTPUT
89+
90+
- name: Create release
91+
uses: softprops/action-gh-release@v2
92+
with:
93+
tag_name: "${{ steps.create-tag.outputs.TAG }}"
94+
name: "Release ${{ steps.create-tag.outputs.TAG }}"
95+
files: |
96+
${{ runner.temp }}/conformance-files.tar.gz
97+
${{ github.workspace }}/src/output/*.json

0 commit comments

Comments
 (0)