Skip to content

Commit

Permalink
ci: refactor with the private nix action
Browse files Browse the repository at this point in the history
Signed-off-by: Thing-han, Lim <[email protected]>
  • Loading branch information
potsrevennil committed Jul 22, 2024
1 parent 85466e6 commit fe6bc2e
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 59 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/amd64-linux-main-proof.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
- main
pull_request:

defaults:
run:
shell: nix develop -c bash -e {0}

jobs:


Expand All @@ -17,18 +21,15 @@ jobs:
- name: checkout
uses: actions/checkout@v4

- uses: DeterminateSystems/magic-nix-cache-action@v4
- name: Setup nix
uses: ./.github/actions/setup-nix

- name: extract and check
uses: workflow/[email protected]
with:
flakes: .
flakes-from-devshell: true
script: |
# extract and check
make -j$JOBS -C proof/ CI=1 default
# dist
./scripts/ci/releaser/jdist-proof
run: |
# extract and check
make -j$JOBS -C proof/ CI=1 default
# dist
./scripts/ci/releaser/jdist-proof
- name: print logs
run: make -C proof/ CI=1 reporter
Expand Down
81 changes: 32 additions & 49 deletions .github/workflows/amd64-linux-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
- main
pull_request:

defaults:
run:
shell: nix develop -c bash -e {0}

jobs:


Expand All @@ -17,15 +21,10 @@ jobs:
- name: checkout
uses: actions/checkout@v4

- uses: DeterminateSystems/magic-nix-cache-action@v4

- name: Setup nix
uses: ./.github/actions/setup-nix
- name: compile
uses: workflow/[email protected]
with:
flakes: .
flakes-from-devshell: true
script: make -j$JOBS -C src/ CI=1 default

run: make -j$JOBS -C src/ CI=1 default
- name: print logs
run: make -C src/ CI=1 reporter
- name: return error if there are any errors
Expand All @@ -47,15 +46,11 @@ jobs:
- name: checkout
uses: actions/checkout@v4

- uses: DeterminateSystems/magic-nix-cache-action@v4
- name: Setup nix
uses: ./.github/actions/setup-nix

- name: compile and run
uses: workflow/[email protected]
with:
flakes: .
flakes-from-devshell: true
script: make -j$JOBS -C test/ CI=1 default

run: make -j$JOBS -C test/ CI=1 default
- name: print logs
run: make -C test/ CI=1 reporter
- name: return error if there are any errors
Expand All @@ -77,14 +72,11 @@ jobs:
- name: checkout
uses: actions/checkout@v4

- uses: DeterminateSystems/magic-nix-cache-action@v4
- name: Setup nix
uses: ./.github/actions/setup-nix

- name: compile
uses: workflow/[email protected]
with:
flakes: .
flakes-from-devshell: true
script: make -j$JOBS -C src/ CI=1 default
run: make -j$JOBS -C src/ CI=1 default

- name: run
run: make -j$JOBS -C bench/ CI=1 DEFINE='-DTIMINGS=10' run
Expand All @@ -111,14 +103,11 @@ jobs:
- name: checkout
uses: actions/checkout@v4

- uses: DeterminateSystems/magic-nix-cache-action@v4
- name: Setup nix
uses: ./.github/actions/setup-nix

- name: compile
uses: workflow/[email protected]
with:
flakes: .
flakes-from-devshell: true
script: make -j$JOBS -C src/ CI=1 default
run: make -j$JOBS -C src/ CI=1 default

- name: run
run: make -j$JOBS -C bench/ CI=1 run DEFINE='-DTIMINGS=10 -DRUNS=2 -DST_ON' RANDINC='../test/common/' RANDLIB='../test/common/notrandombytes.c';
Expand All @@ -145,18 +134,15 @@ jobs:
- name: checkout
uses: actions/checkout@v4

- uses: DeterminateSystems/magic-nix-cache-action@v4
- name: Setup nix
uses: ./.github/actions/setup-nix

- name: extract and check
uses: workflow/[email protected]
with:
flakes: .
flakes-from-devshell: true
script: |
# extract and check
make -j$JOBS -C proof/ CI=1 check-extracted
# dist
./scripts/ci/releaser/jdist-proof
run: |
# extract and check
make -j$JOBS -C proof/ CI=1 check-extracted
# dist
./scripts/ci/releaser/jdist-proof
- name: print logs
run: make -C proof/ CI=1 reporter
Expand Down Expand Up @@ -187,20 +173,17 @@ jobs:
- name: checkout
uses: actions/checkout@v4

- uses: DeterminateSystems/magic-nix-cache-action@v4
- name: Setup nix
uses: ./.github/actions/setup-nix

- name: dist amd64
uses: workflow/[email protected]
with:
flakes: .
flakes-from-devshell: true
script: |
# compile amd64
make -j$JOBS -C src/ CI=1 default
# dist amd64
./scripts/ci/releaser/jdist-src-v1 amd64
# check dist amd64
./scripts/ci/releaser/jdist-src-test-v1 amd64
run: |
# compile amd64
make -j$JOBS -C src/ CI=1 default
# dist amd64
./scripts/ci/releaser/jdist-src-v1 amd64
# check dist amd64
./scripts/ci/releaser/jdist-src-test-v1 amd64
- name: libjade-dist-src-amd64.tar.gz - contains assembly, Jasmin, and how-to-use code
if: always()
Expand Down

0 comments on commit fe6bc2e

Please sign in to comment.