-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from MathieuSoysal/39-create-a-archive-file-th…
…at-contains-all-logement Road to v1.8.0
- Loading branch information
Showing
48 changed files
with
1,027 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Integration Tests | ||
|
||
on: | ||
push: | ||
branches: [ master, beta ] | ||
pull_request: | ||
branches: [ master, beta ] | ||
workflow_call: | ||
|
||
jobs: | ||
unit-test: | ||
timeout-minutes: 60 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
- name: Build & Install | ||
run: mvn -B install -D skipTests --no-transfer-progress | ||
- name: Install Playwright | ||
run: mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="install --with-deps" | ||
- name: Run tests | ||
run: mvn test | ||
env: | ||
SPECIFIC_DAY: "2024-01-03" | ||
ARCHIVE_MODE: HOUR | ||
TEST_MAIL : ${{ secrets.TEST_MAIL }} | ||
TEST_PASSWORD : ${{ secrets.TEST_PASSWORD }} | ||
|
||
creating-archive-with-connection: | ||
needs: unit-test | ||
uses: ./.github/workflows/reusable-archiving.yml | ||
with: | ||
ARCHIVE_MODE: HOUR | ||
secrets: | ||
MAIL : ${{ secrets.TEST_MAIL }} | ||
PASSWORD : ${{ secrets.TEST_PASSWORD }} | ||
|
||
creating-archive-day-sum-up: | ||
needs: unit-test | ||
uses: ./.github/workflows/reusable-archiving.yml | ||
with: | ||
ARCHIVE_MODE: DAY_SUM_UP | ||
SPECIFIC_DAY: "2024-01-03" | ||
LINK_TO_DATA: https://mathieusoysal.github.io/CROUS-assistant-Collector/v1/logements-crous/available | ||
|
||
creating-archive-all-logement: | ||
needs: unit-test | ||
uses: ./.github/workflows/reusable-archiving.yml | ||
with: | ||
ARCHIVE_MODE: ALL_LOGEMENTS | ||
SPECIFIC_DAY: "2024-01-03" | ||
LINK_TO_DATA: https://mathieusoysal.github.io/CROUS-assistant-Collector/v1/logements-crous/available |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,40 @@ | ||
name: Archiving data | ||
name: Archiving data for day summary | ||
|
||
on: | ||
schedule: | ||
- cron: '40 23 * * *' | ||
workflow_dispatch: | ||
inputs: | ||
specific-date: | ||
description: 'Specific date to archive' | ||
required: true | ||
default: '2024-01-01' | ||
|
||
jobs: | ||
creating-archive: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
cache: 'maven' | ||
- name: Install Playwright | ||
run: mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="install --with-deps" | ||
- name: archive | ||
run: | | ||
(echo "===== Maven Deploy Attempt: 1 ====" && mvn install -DskipTests=true -Dmaven.javadoc.skip=true -PArchiving exec:java) || \ | ||
(echo "===== Maven Deploy Attempt: 2 ====" && mvn install -DskipTests=true -Dmaven.javadoc.skip=true -PArchiving exec:java) || \ | ||
(echo "===== Maven Deploy Attempt: 3 ====" && mvn install -DskipTests=true -Dmaven.javadoc.skip=true -PArchiving exec:java) || \ | ||
(echo "==== Maven Deploy Step Failed ====" && exit 1) | ||
env: | ||
LINK_TO_DATA: https://mathieusoysal.github.io/CROUS-assistant-Collector/v1/logements-crous/available | ||
- uses: JamesIves/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
clean: false | ||
branch: api | ||
folder: archive | ||
target-folder: v1/logements-crous/available | ||
creating-archive-schedule: | ||
permissions: | ||
contents: write | ||
if: github.event_name == 'schedule' | ||
uses: ./.github/workflows/reusable-archiving.yml | ||
with: | ||
ARCHIVE_MODE: DAY_SUM_UP | ||
LINK_TO_DATA: https://mathieusoysal.github.io/CROUS-assistant-Collector/v1/logements-crous/available | ||
deploy: true | ||
secrets: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
creating-archive-manual: | ||
permissions: | ||
contents: write | ||
if: github.event_name == 'workflow_dispatch' | ||
uses: ./.github/workflows/reusable-archiving.yml | ||
with: | ||
SPECIFIC_DAY: ${{ github.event.inputs.specific-date }} | ||
ARCHIVE_MODE: DAY_SUM_UP | ||
LINK_TO_DATA: https://mathieusoysal.github.io/CROUS-assistant-Collector/v1/logements-crous/available | ||
deploy: true | ||
secrets: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Archiving data for hour | ||
|
||
on: | ||
schedule: | ||
- cron: '10 * * * *' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
creating-archive: | ||
permissions: | ||
contents: write | ||
uses: ./.github/workflows/reusable-archiving.yml | ||
with: | ||
ARCHIVE_MODE: HOUR | ||
deploy: true | ||
secrets: | ||
MAIL : ${{ secrets.TEST_MAIL }} | ||
PASSWORD : ${{ secrets.TEST_PASSWORD }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
rerun-failed-jobs: | ||
runs-on: ubuntu-latest | ||
needs: creating-archive | ||
if: failure() | ||
steps: | ||
- name: Rerun failed jobs in the current workflow | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: gh run rerun ${{ github.run_id }} --failed | ||
|
||
|
||
|
||
|
||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: Archiving data with reusable workflow | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
ARCHIVE_MODE: | ||
description: 'The mode of archiving' | ||
required: true | ||
type: string | ||
default: 'HOUR' | ||
LINK_TO_DATA: | ||
description: 'The link to the data to archive' | ||
required: false | ||
type: string | ||
default: 'https://mathieusoysal.github.io/CROUS-assistant-Collector/v1/logements-crous/available' | ||
SPECIFIC_DAY: | ||
description: 'The day to archive, day is used olny if ARCHIVE_MODE is DAY' | ||
required: false | ||
type: string | ||
default: '' | ||
deploy: | ||
description: 'Deploy the archive to github pages' | ||
required: false | ||
type: boolean | ||
default: false | ||
target-folder: | ||
description: 'The target folder to deploy the archive to github pages' | ||
required: false | ||
type: string | ||
default: 'v1/logements-crous' | ||
|
||
secrets: | ||
MAIL: | ||
description: 'The mail to send the archive to hour, mail is used olny if ARCHIVE_MODE is HOUR' | ||
PASSWORD: | ||
description: 'The password of the mail to send the archive to hour, password is used olny if ARCHIVE_MODE is HOUR' | ||
token: | ||
description: 'The token to deploy the archive to github pages' | ||
|
||
jobs: | ||
creating-archive: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
cache: 'maven' | ||
- name: Install Playwright | ||
run: mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="install --with-deps" | ||
|
||
- name: set specific day when input is not empty | ||
if: inputs.SPECIFIC_DAY != '' | ||
run: echo "SPECIFIC_DAY=${{ inputs.SPECIFIC_DAY }}" >> $GITHUB_ENV | ||
|
||
- name: archive | ||
run: | | ||
(echo "===== Maven Deploy Attempt: 1 ====" && mvn install -DskipTests=true -Dmaven.javadoc.skip=true -PArchiving exec:java) || \ | ||
(echo "===== Maven Deploy Attempt: 2 ====" && mvn install -DskipTests=true -Dmaven.javadoc.skip=true -PArchiving exec:java) || \ | ||
(echo "===== Maven Deploy Attempt: 3 ====" && mvn install -DskipTests=true -Dmaven.javadoc.skip=true -PArchiving exec:java) || \ | ||
(echo "==== Maven Deploy Step Failed ====" && exit 1) | ||
env: | ||
LINK_TO_DATA: ${{ inputs.LINK_TO_DATA }} | ||
ARCHIVE_MODE: ${{ inputs.ARCHIVE_MODE }} | ||
MAIL: ${{ secrets.MAIL }} | ||
PASSWORD: ${{ secrets.PASSWORD }} | ||
- name: Deploy to Github Pages | ||
if: inputs.deploy == true | ||
uses: JamesIves/[email protected] | ||
with: | ||
token: ${{ secrets.token }} | ||
clean: false | ||
branch: api | ||
folder: archive | ||
target-folder: ${{ inputs.target-folder }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Update all logements | ||
|
||
on: | ||
schedule: | ||
- cron: '40 23 * * *' | ||
workflow_dispatch: | ||
inputs: | ||
specific-date: | ||
description: 'Specific date to archive' | ||
required: true | ||
default: '2024-01-01' | ||
|
||
jobs: | ||
creating-archive-schedule: | ||
permissions: | ||
contents: write | ||
if: github.event_name == 'schedule' | ||
uses: ./.github/workflows/reusable-archiving.yml | ||
with: | ||
ARCHIVE_MODE: ALL_LOGEMENTS | ||
LINK_TO_DATA: https://mathieusoysal.github.io/CROUS-assistant-Collector/v1/logements-crous/available | ||
target-folder: 'v1/logements-crous' | ||
deploy: true | ||
secrets: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
creating-archive-manual: | ||
permissions: | ||
contents: write | ||
if: github.event_name == 'workflow_dispatch' | ||
uses: ./.github/workflows/reusable-archiving.yml | ||
with: | ||
SPECIFIC_DAY: ${{ github.event.inputs.specific-date }} | ||
ARCHIVE_MODE: ALL_LOGEMENTS | ||
LINK_TO_DATA: https://mathieusoysal.github.io/CROUS-assistant-Collector/v1/logements-crous/available | ||
target-folder: 'v1/logements-crous' | ||
deploy: true | ||
secrets: | ||
token: ${{ secrets.GITHUB_TOKEN }} |
Oops, something went wrong.