Skip to content

Commit 4f3671e

Browse files
authored
Merge pull request #119 from DeterminateSystems/integration-test
Add integration test workflow
2 parents 42a91dd + 79fcbc2 commit 4f3671e

File tree

6 files changed

+73
-53
lines changed

6 files changed

+73
-53
lines changed

.github/workflows/build.yaml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,30 @@ name: Build flake-checker artifacts
33
on:
44
workflow_call:
55
workflow_dispatch:
6-
pull_request:
7-
push:
8-
branches: [main]
96

107
jobs:
118
build-artifacts:
129
runs-on: ${{ matrix.systems.runner }}
1310
permissions:
1411
id-token: "write"
1512
contents: "read"
13+
env:
14+
ARTIFACT_KEY: flake-checker-${{ matrix.systems.system }}
1615
strategy:
1716
matrix:
1817
systems:
1918
- nix-system: aarch64-darwin
2019
runner: macos-latest-xlarge
21-
artifact: flake-checker-ARM64-macOS
20+
system: ARM64-macOS
2221
- nix-system: x86_64-darwin
2322
runner: macos-12
24-
artifact: flake-checker-X64-macOS
23+
system: X64-macOS
2524
- nix-system: aarch64-linux
2625
runner: namespace-profile-default-arm64
27-
artifact: flake-checker-X64-Linux
26+
system: ARM64-Linux
2827
- nix-system: x86_64-linux
2928
runner: ubuntu-22.04
30-
artifact: flake-checker-ARM64-Linux
29+
system: X64-Linux
3130
steps:
3231
- name: git checkout
3332
uses: actions/checkout@v4
@@ -40,14 +39,19 @@ jobs:
4039
with:
4140
use-flakehub: true
4241

42+
- name: Build and cache dev shell for ${{ matrix.systems.nix-system }} on ${{ matrix.systems.runner }}
43+
run: |
44+
nix build -L ".#devShells.${{ matrix.systems.nix-system }}.default"
45+
4346
- name: Build package for ${{ matrix.systems.nix-system }}
4447
run: |
4548
nix build -L ".#packages.${{ matrix.systems.nix-system }}.default"
49+
cp ./result/bin/flake-checker flake-checker
4650
47-
- name: Upload a Build Artifact
48-
uses: actions/upload-artifact@v3.1.2
51+
- name: Upload flake-checker executable for ${{ matrix.systems.system }}
52+
uses: actions/upload-artifact@v4.3.3
4953
with:
5054
# Artifact name
51-
name: ${{ matrix.systems.artifact }}
52-
path: result/bin/flake-checker
55+
name: ${{ env.ARTIFACT_KEY }}
56+
path: flake-checker
5357
retention-days: 1

.github/workflows/ci.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,49 @@ jobs:
7272
- name: Check flake.lock
7373
run: |
7474
nix develop -c cargo run -- --fail-mode ./tests/flake.dirty.0.lock
75+
76+
build-artifacts:
77+
name: Build artifacts
78+
needs: checks
79+
uses: ./.github/workflows/build.yaml
80+
secrets: inherit
81+
82+
action-integration-test:
83+
name: Integration test for flake-checker-action
84+
needs: build-artifacts
85+
runs-on: ${{ matrix.systems.runner }}
86+
permissions:
87+
contents: read
88+
id-token: write
89+
env:
90+
ARTIFACT_KEY: flake-checker-${{ matrix.systems.system }}
91+
strategy:
92+
matrix:
93+
systems:
94+
- system: X64-Linux
95+
runner: ubuntu-22.04
96+
- system: ARM64-Linux
97+
runner: namespace-profile-default-arm64
98+
- system: X64-macOS
99+
runner: macos-12
100+
- system: ARM64-macOS
101+
runner: macos-latest-xlarge
102+
steps:
103+
- uses: actions/checkout@v4
104+
105+
- name: Download flake-checker for ${{ matrix.systems.system }}
106+
uses: actions/[email protected]
107+
with:
108+
name: ${{ env.ARTIFACT_KEY }}
109+
path: ${{ env.ARTIFACT_KEY }}
110+
111+
- name: chmod flake-checker executable on ${{ matrix.systems.system }}
112+
run: |
113+
chmod +x "${{ env.ARTIFACT_KEY }}/flake-checker"
114+
115+
file "${{ env.ARTIFACT_KEY }}/flake-checker"
116+
117+
- name: Test flake-checker-action@main on ${{ matrix.systems.runner }}
118+
uses: DeterminateSystems/flake-checker-action@main
119+
with:
120+
source-binary: ${{ env.ARTIFACT_KEY }}/flake-checker

.github/workflows/flakehub-cache.yaml

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

.github/workflows/release-branches.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,28 +31,28 @@ jobs:
3131
- name: Create the artifacts directory
3232
run: rm -rf ./artifacts && mkdir ./artifacts
3333

34-
- uses: actions/download-artifact@v3
34+
- uses: actions/download-artifact@v4.1.7
3535
with:
3636
name: flake-checker-ARM64-macOS
3737
path: cache-binary-ARM64-macOS
3838
- name: Persist the cache binary
3939
run: cp ./cache-binary-ARM64-macOS/flake-checker ./artifacts/flake-checker-ARM64-macOS
4040

41-
- uses: actions/download-artifact@v3
41+
- uses: actions/download-artifact@v4.1.7
4242
with:
4343
name: flake-checker-X64-macOS
4444
path: cache-binary-X64-macOS
4545
- name: Persist the cache binary
4646
run: cp ./cache-binary-X64-macOS/flake-checker ./artifacts/flake-checker-X64-macOS
4747

48-
- uses: actions/download-artifact@v3
48+
- uses: actions/download-artifact@v4.1.7
4949
with:
5050
name: flake-checker-X64-Linux
5151
path: cache-binary-X64-Linux
5252
- name: Persist the cache binary
5353
run: cp ./cache-binary-X64-Linux/flake-checker ./artifacts/flake-checker-X64-Linux
5454

55-
- uses: actions/download-artifact@v3
55+
- uses: actions/download-artifact@v4.1.7
5656
with:
5757
name: flake-checker-ARM64-Linux
5858
path: cache-binary-ARM64-Linux

.github/workflows/release-prs.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,28 +35,28 @@ jobs:
3535
- name: Create the artifacts directory
3636
run: rm -rf ./artifacts && mkdir ./artifacts
3737

38-
- uses: actions/download-artifact@v3
38+
- uses: actions/download-artifact@v4.1.7
3939
with:
4040
name: flake-checker-ARM64-macOS
4141
path: cache-binary-ARM64-macOS
4242
- name: Persist the cache binary
4343
run: cp ./cache-binary-ARM64-macOS/flake-checker ./artifacts/flake-checker-ARM64-macOS
4444

45-
- uses: actions/download-artifact@v3
45+
- uses: actions/download-artifact@v4.1.7
4646
with:
4747
name: flake-checker-X64-macOS
4848
path: cache-binary-X64-macOS
4949
- name: Persist the cache binary
5050
run: cp ./cache-binary-X64-macOS/flake-checker ./artifacts/flake-checker-X64-macOS
5151

52-
- uses: actions/download-artifact@v3
52+
- uses: actions/download-artifact@v4.1.7
5353
with:
5454
name: flake-checker-X64-Linux
5555
path: cache-binary-X64-Linux
5656
- name: Persist the cache binary
5757
run: cp ./cache-binary-X64-Linux/flake-checker ./artifacts/flake-checker-X64-Linux
5858

59-
- uses: actions/download-artifact@v3
59+
- uses: actions/download-artifact@v4.1.7
6060
with:
6161
name: flake-checker-ARM64-Linux
6262
path: cache-binary-ARM64-Linux

.github/workflows/release-tags.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,28 @@ jobs:
2424
- name: Create the artifacts directory
2525
run: rm -rf ./artifacts && mkdir ./artifacts
2626

27-
- uses: actions/download-artifact@v3
27+
- uses: actions/download-artifact@v4.1.7
2828
with:
2929
name: flake-checker-ARM64-macOS
3030
path: cache-binary-ARM64-macOS
3131
- name: Persist the cache binary
3232
run: cp ./cache-binary-ARM64-macOS/flake-checker ./artifacts/flake-checker-ARM64-macOS
3333

34-
- uses: actions/download-artifact@v3
34+
- uses: actions/download-artifact@v4.1.7
3535
with:
3636
name: flake-checker-X64-macOS
3737
path: cache-binary-X64-macOS
3838
- name: Persist the cache binary
3939
run: cp ./cache-binary-X64-macOS/flake-checker ./artifacts/flake-checker-X64-macOS
4040

41-
- uses: actions/download-artifact@v3
41+
- uses: actions/download-artifact@v4.1.7
4242
with:
4343
name: flake-checker-X64-Linux
4444
path: cache-binary-X64-Linux
4545
- name: Persist the cache binary
4646
run: cp ./cache-binary-X64-Linux/flake-checker ./artifacts/flake-checker-X64-Linux
4747

48-
- uses: actions/download-artifact@v3
48+
- uses: actions/download-artifact@v4.1.7
4949
with:
5050
name: flake-checker-ARM64-Linux
5151
path: cache-binary-ARM64-Linux

0 commit comments

Comments
 (0)