From 16c996ab3e5c9e52a8db2c13640f8c33344da906 Mon Sep 17 00:00:00 2001 From: Alisue Date: Thu, 24 Oct 2024 11:30:40 +0900 Subject: [PATCH] Add GitHub Action to test --- .github/workflows/test.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..fcffdd1 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,38 @@ +name: Test + +on: [push] + +jobs: + check: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - run: docker build . + + test: + needs: check + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Basic usage + uses: ./ + with: + connection-string: ${{ secrets.AZURE_STORAGE_CONNECTION_STRING }} + container: "azblob-generate-static-index" + prefix: "some" + overwrite: "true" + + - name: Check if 'index.html' is correct + run: | + az storage blob download \ + --connection-string "${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}" \ + --container-name azblob-generate-static-index \ + --name some/index.html \ + --file index.html.downloaded + + grep -q 'hello.txt' index.html.downloaded + grep -q 'world.txt' index.html.downloaded