Add integration test workflow

This commit is contained in:
Luc Perkins 2024-05-17 16:52:30 -03:00
parent 3a1558438f
commit d677f3a332
No known key found for this signature in database
GPG key ID: 16DB1108FB591835
2 changed files with 46 additions and 0 deletions

10
.editorconfig Normal file
View file

@ -0,0 +1,10 @@
# https://editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

36
.github/workflows/test.yaml vendored Normal file
View file

@ -0,0 +1,36 @@
name: Integration tests
on:
pull_request:
push:
branches: [main]
jobs:
checks:
runs-on: ubuntu-22.04
permissions:
contents: read
id-token: write
env:
FLAKEHUB_API_ENDPOINT: "api.flakehub.com"
FLAKEHUB_WEB_ENDPOINT: "https://flakehub.com"
steps:
- uses: actions/checkout@v3
- name: Get JWT
id: jwt
run: |
REQUEST_TOKEN="${ACTIONS_ID_TOKEN_REQUEST_TOKEN}"
ROOT_URL="${ACTIONS_ID_TOKEN_REQUEST_URL}"
JWT_ID_TOKEN=$(curl \
--header "authorization: bearer ${REQUEST_TOKEN}" \
--header "accept: application/json;api-version=2.0" \
--header "content-type: application/json" \
--header "user-agent: magic-nix-cache" \
"${ROOT_URL}&audience=${{ env.FLAKEHUB_API_ENDPOINT }}")
echo "::set-output name=token::${JWT_ID_TOKEN}"
- name: Display token
run: |
echo "${{ steps.jwt.outputs.token }}"